io.notificationsAPIinterface
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. |
26 Methods
clear()⚓︎
(id: string) => Promise<void>
Clears a specified notification.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| id⚓︎ | string | The id of the notification to be removed. |
clearMany()⚓︎
(notifications: string[]) => Promise<void>
Clears multiple notifications using a list of IDs.
io.Connect Desktop 9.5Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| notifications⚓︎ | string[] | List of IDs of the notifications to clear. |
click()⚓︎
(id: string, action?: string) => Promise<void>
configure()⚓︎
(options: Configuration) => Promise<void>
Configures the Global notification settings.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| options⚓︎ | Configuration | configuration options |
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.
getPermission()⚓︎
() => Promise<"default" | "granted" | "denied">
io.Connect Browser only. Retrieves the state of the native browser notification permission for the platform.
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.
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. |
onActiveCountChanged()⚓︎
(callback: (info: { count: number; }) => void) => UnsubscribeFunction
Notifies when the number of active notification is changed.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| callback⚓︎ | (info: { count: number; }) => void | Callback function for handling the event. |
onClosed()⚓︎
(callback: (notification: { id: string }) => void) => UnsubscribeFunction
Notifies the user when a notification was removed via the Notifications API.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| callback⚓︎ | (notification: { id: string }) => void | A function which will be called when a notification is removed. |
onConfigurationChanged()⚓︎
(callback: (configuration: Configuration) => void) => UnsubscribeFunction
Notifies when the global notification settings are changed.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| callback⚓︎ | (configuration: Configuration) => void | Callback function for handling the event. |
onCounterChanged()⚓︎
(callback: (info: { count: number; }) => void) => UnsubscribeFunction
Alias for onActiveCountChanged() for compatibility with io.Connect Desktop.
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 the user of any new raised notifications via the Notifications API.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| callback⚓︎ | (notification: NotificationData) => void | A function which will be called when a new notification is raised. |
onStateChanged()⚓︎
(callback: (notification: { id: string; }, state: State) => void) => UnsubscribeFunction
raise()⚓︎
(notification: RaiseOptions) => Promise<Notification>
Raises a new notification
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| notification⚓︎ | RaiseOptions | notification options |
requestPermission()⚓︎
() => Promise<boolean>
io.Connect Browser only. Triggers the native browser permission dialog. Must only be called from within a platform.
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. |
snooze()⚓︎
(id: string, duration: number) => Promise<void>
snoozeMany()⚓︎
(notifications: string[], duration: number) => Promise<void>
updateData()⚓︎
(id: string, data: unknown) => Promise<void>