Skip to main content
Access via:io.notifications

Notifications API.

Properties (2)

Property Type Default Required Description
maxActions⚓︎ number x

The maximum number of notification actions that is supported.

panel⚓︎ NotificationPanelAPI x

API for controlling the Notification Panel.

23 Methods

clear()⚓︎

(id: string) => Promise<void>

Clears a notification by ID.

Parameters (1)

Name Type Required Description
id⚓︎ string

ID of the notification to clear.

clearAll()⚓︎

() => Promise<void>

Clears all notifications.

clearMany()⚓︎

(notifications: string[]) => Promise<void>

Clears multiple notifications using a list of IDs.

io.Connect Desktop 9.5

Parameters (1)

Name Type Required Description
notifications⚓︎ string[]

List of IDs of the notifications to clear.

clearOld()⚓︎

() => Promise<void>

Clears all notifications in the Notification Panel that the user has already seen.

click()⚓︎

(id: string, action?: string, options?: ClickOptions) => Promise<void>

Clicks programmatically a notification or a notification action.

Parameters (3)

Name Type Required Description
id⚓︎ string

ID of the notification to click.

action⚓︎ string x

ID of the action to click.

options⚓︎ ClickOptions x

Options for the clicked notification.

configure()⚓︎

(options: Configuration) => Promise<void>

Configures the global notification settings.

Parameters (1)

Name Type Required Description
options⚓︎ Configuration

Global notification settings.

getConfiguration()⚓︎

() => Promise<Configuration>

Retrieves the current global notification settings.

getFilter()⚓︎

() => Promise<NotificationFilter>

Retrieves the current filter with apps allowed or not allowed to raise notifications.

import()⚓︎

(notificationOptions: IOConnectNotificationOptions[]) => Promise<NotificationData[]>

Imports a list of notifications into the platform. Only imported notifications with state "Active" will be shown as notification toasts. All imported notifications will be available in the Notification Panel. An event for raising a notification will be triggered for all imported notifications.

io.Connect Desktop 9.6

Parameters (1)

Name Type Required Description
notificationOptions⚓︎ IOConnectNotificationOptions[]

List of objects each describing a notification to import. The notification options for importing notifications are identical to the ones for raising a notification.

list()⚓︎

() => Promise<NotificationData[]>

Retrieves a list of objects describing all available notifications.

onClosed()⚓︎

(callback: (notification: { id: string }) => void) => UnsubscribeFunction

Notifies when a notification is closed.

Parameters (1)

Name Type Required Description
callback⚓︎ (notification: { id: string }) => void

Callback function for handling the event.

onConfigurationChanged()⚓︎

(callback: (config: Configuration) => void) => UnsubscribeFunction

Notifies when the global notification settings are changed.

Parameters (1)

Name Type Required Description
callback⚓︎ (config: Configuration) => void

Callback function for handling the event.

onCounterChanged()⚓︎

(callback: (info: { count: number }) => void) => UnsubscribeFunction

Notifies when the notification counter is changed.

Parameters (1)

Name Type Required Description
callback⚓︎ (info: { count: number }) => void

Callback function for handling the event.

onDataChanged()⚓︎

<T>(callback: (notification: { id: string }, data: T) => void) => UnsubscribeFunction

Notifies when the arbitrary data associated with the notification (available in the data property of the notification) is changed.

Parameters (1)

Name Type Required Description
callback⚓︎ (notification: { id: string }, data: T) => void

Callback function for handling the event.

onRaised()⚓︎

(callback: (notification: NotificationData) => void) => UnsubscribeFunction

Notifies when a new notification is raised.

Parameters (1)

Name Type Required Description
callback⚓︎ (notification: NotificationData) => void

Callback function for handling the event.

onStateChanged()⚓︎

(callback: (notification: { id: string }, state: State) => void) => UnsubscribeFunction

Notifies when the state of a notification is changed.

Parameters (1)

Name Type Required Description
callback⚓︎ (notification: { id: string }, state: State) => void

Callback function for handling the event.

raise()⚓︎

(notification: IOConnectNotificationOptions) => Promise<Notification>

Raises a new notification.

Parameters (1)

Name Type Required Description
notification⚓︎ IOConnectNotificationOptions

Options for the raised notification.

setFilter()⚓︎

(filter: NotificationFilter) => Promise<NotificationFilter>

Sets a filter with apps allowed or not allowed to raise notifications.

Parameters (1)

Name Type Required Description
filter⚓︎ NotificationFilter

Filter with names of apps allowed or not allowed to raise notifications.

setState()⚓︎

(id: string, state: State) => Promise<void>

Sets the state of a notification.

Parameters (2)

Name Type Required Description
id⚓︎ string

ID of the notification to change.

state⚓︎ State

Value for the new notification state.

setStates()⚓︎

(notifications: string[], state: State) => Promise<void>

Sets multiple notifications to the same notification state.

io.Connect Desktop 9.5

Parameters (2)

Name Type Required Description
notifications⚓︎ string[]

List of IDs of the notifications whose state to set.

state⚓︎ State

Value for the new notification state.

snooze()⚓︎

(id: string, duration: number) => Promise<void>

Snoozes a notification.

Parameters (2)

Name Type Required Description
id⚓︎ string

ID of the notification to snooze.

duration⚓︎ number

Interval in milliseconds for which to snooze the notification.

snoozeMany()⚓︎

(notifications: string[], duration: number) => Promise<void>

Snoozes multiple notifications for the same duration.

io.Connect Desktop 9.5

Parameters (2)

Name Type Required Description
notifications⚓︎ string[]

List of IDs of the notifications to snooze.

duration⚓︎ number

Interval in milliseconds for which to snooze the notifications.

updateData()⚓︎

(id: string, data: unknown) => Promise<void>

Sets or updates the arbitrary data associated with the notification which is available in the data property of the notification.

Parameters (2)

Name Type Required Description
id⚓︎ string

ID of the notification whose data to update.

data⚓︎ unknown

New notification data.