• Back to Glue42 Enterprise Docs
Glue42 enterprise documentation

Reference Documentation

  • Back to Glue42 Enterprise Docs
Press/
  • Glue
  • App Management
  • App Preferences
  • Channels
  • Connection
  • Cookies
  • Displays
  • Hotkeys
  • Intents
  • Interop
  • Layouts
  • Logger
  • Metrics
  • Notifications
  • Pub Sub
  • Shared Contexts
  • Themes
  • Windows
  • Workspaces

Notifications

5.23.0

The Notifications API allows you to raise notifications, handle notification and action clicks via Interop methods, control the Notification Panel and subscribe for notification events.

The Notifications API is accessible through the glue.notifications object.

APIobject

Description

Notifications API

Available since version Glue42 3.9

Properties

Property Type Default Required Description
maxActions number

The maximum number of notification actions that is supported.

panel NotificationPanelAPI

API for controlling the Notification Panel.

Available since version Glue42 3.12.1

Methods

  • clear
  • clearAll
  • clearOld
  • click
  • configure
  • getConfiguration
  • getFilter
  • list
  • onClosed
  • onConfigurationChanged
  • onCounterChanged
  • onRaised
  • onStateChanged
  • raise
  • setFilter
  • setState

clearmethod

Signature

(id: string) => Promise<void>

Description

Clears a notification by ID.

Available since version Glue42 3.22

Parameters

Name Type Required Description
id string

ID of the notification to clear.

clearAllmethod

Signature

() => Promise<void>

Description

Clears all notifications.

Available since version Glue42 3.22

clearOldmethod

Signature

() => Promise<void>

Description

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

Available since version Glue42 3.22

clickmethod

Signature

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

Description

Clicks programmatically a notification or a notification action.

Available since version Glue42 3.22

Parameters

Name Type Required Description
id string

ID of the notification to click.

action string

ID of the action to click.

configuremethod

Signature

(options: Configuration) => Promise<void>

Description

Configures the global notification settings.

Parameters

Name Type Required Description
options Configuration

Object holding global notification settings.

getConfigurationmethod

Signature

() => Promise<Configuration>

Description

Retrieves the current global notification settings.

getFiltermethod

Signature

() => Promise<NotificationFilter>

Description

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

listmethod

Signature

() => Promise<NotificationData[]>

Description

Retrieves a list of objects describing all available notifications.

onClosedmethod

Signature

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

Description

Notifies when a notification is closed.

Available since version Glue42 3.22

Parameters

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

Callback function for handling the event.

onConfigurationChangedmethod

Signature

(callback: (config: Configuration, apps: number) => void) => UnsubscribeFunction

Description

Notifies when the global notification settings are changed.

Available since version Glue42 3.22

Parameters

Name Type Required Description
callback (config: Configuration, apps: number) => void

Callback function for handling the event.

onCounterChangedmethod

Signature

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

Description

Notifies when the notification counter is changed.

Available since version Glue42 3.22

Parameters

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

Callback function for handling the event.

onRaisedmethod

Signature

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

Description

Notifies when a new notification is raised.

Available since version Glue42 3.22

Parameters

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

Callback function for handling the event.

onStateChangedmethod

Signature

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

Description

Notifies when the state of a notification is changed.

Available since version Glue42 3.22

Parameters

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

Callback function for handling the event.

raisemethod

Signature

(notification: Glue42NotificationOptions) => Promise<Glue42Notification>

Description

Raises a new notification.

Parameters

Name Type Required Description
notification Glue42NotificationOptions

Object with options for the raised notification.

setFiltermethod

Signature

(filter: NotificationFilter) => Promise<NotificationFilter>

Description

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

Parameters

Name Type Required Description
filter NotificationFilter

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

setStatemethod

Signature

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

Description

Sets the state of a notification.

Available since version Glue42 3.22

Parameters

Name Type Required Description
id string

ID of the notification to change.

state State

Value for the new notification state.

ActionEventobject

Description

Describes a notification action event.

Properties

Property Type Default Required Description
action string

The name of the notification action executed by the user.

Configurationobject

Description

Global notification settings.

Properties

Property Type Default Required Description
enable boolean

If true, will enable all notifications - notification toasts and notifications in the Notification Panel.

enableToasts boolean

If true, will enable notification toasts.

sourceFilter NotificationFilter

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

toastExpiry number

Interval in seconds after which the notification toasts will be hidden.

Glue42Notificationobject

Description

Object describing a raised notification.

Properties

Property Type Default Required Description
actions Glue42NotificationAction[]

Array of objects describing the available notification actions.

appIcon string

Icon of the app that has raised the notification.

appTitle string

Title of the app that has raised the notification.

close () => void

Closes the notification.

id string

ID of the notification.

instanceId string

ID of the app instance that has raised the notification.

onaction (ev: ActionEvent) => any

Notifies when a notification action has been clicked.

onclick (ev: Event) => any

Notifies when the notification has been clicked.

onshow (ev: Event) => any

Notifies when the notification has been shown.

state State

State of the raised notification.

Glue42NotificationActionobject

Description

Object describing a notification action.

Properties

Property Type Default Required Description
action string

Name of the notification action.

icon string

Icon for the notification action.

interop InteropActionSettings

Object with settings for invoking an Interop method when the notification action is clicked.

title string

Title of the notification action that will be used in the notification action button.

Glue42NotificationOptionsobject

Description

Options for raising a notification.

Properties

Property Type Default Required Description
actions Glue42NotificationAction[]

Array of objects describing notification actions. The notification actions will be displayed as buttons in the notification.

badge string
body string
clickInterop InteropActionSettings

Object with settings for invoking an Interop method when the notification is clicked.

data any
dir NotificationDirection
icon string
image string
lang string
panelExpiry number

Interval in seconds after which the notification will be removed from the Notification Panel.

renotify boolean
requireInteraction boolean
severity "Low" | "Medium" | "High" | "Critical" | "None"

Severity of the notification.

silent boolean
source string

Can be used for overwriting the name of the actual notification source.

tag string
timestamp number
title string

Title for the notification.

toastExpiry number

Interval in seconds after which the notification toast will be hidden.

type "Notification" | "Alert"

Type of the notification. "Notification" is usually a general non-urgent notification, while "Alert" is an urgent one.

vibrate VibratePattern

InteropActionSettingsobject

Description

Object with settings for invoking an Interop method when a notification or a notification action is clicked.

Properties

Property Type Default Required Description
arguments any

Object with arguments for the Interop method invocation.

method string

Name of the Interop method to invoke.

target "best" | "all"

Specifies which Interop servers to target when invoking the Interop method - "all" will invoke the method on all apps that have registered it, while "best" will invoke it only on the first app that has registered it.

NotificationDataobject

Description

Object describing a notification.

Properties

Property Type Default Required Description
actions Glue42NotificationAction[]

Array of objects describing notification actions. The notification actions will be displayed as buttons in the notification.

appIcon string

Icon of the app that has raised the notification.

appTitle string

Title of the app that has raised the notification.

clickInterop InteropActionSettings

Object with settings for invoking an Interop method when the notification is clicked.

id string

ID of the notification.

instanceId string

ID of the app instance that has raised the notification.

panelExpiry number

Interval in seconds after which the notification will be removed from the Notification Panel.

severity "Low" | "Medium" | "High" | "Critical" | "None"

Severity of the notification.

source string

Can be used for overwriting the name of the actual notification source.

state State

State of the raised notification.

title string

Title for the notification.

toastExpiry number

Interval in seconds after which the notification toast will be hidden.

type "Notification" | "Alert"

Type of the notification. "Notification" is usually a general non-urgent notification, while "Alert" is an urgent one.

NotificationFilterobject

Description

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

Properties

Property Type Default Required Description
allowed string[]

Array of names of apps allowed to raise notifications.

blocked string[]

Array of names of apps not allowed to raise notifications.

NotificationPanelAPIobject

Description

API for controlling the Notification Panel.

Available since version Glue42 3.12.1

Methods

  • hide
  • isVisible
  • onVisibilityChanged
  • show
  • toggle

hidemethod

Signature

() => Promise<void>

Description

Hides the Notification Panel.

isVisiblemethod

Signature

() => Promise<boolean>

Description

Checks whether the Notification Panel is visible.

onVisibilityChangedmethod

Signature

(callback: (isVisible: boolean) => any) => UnsubscribeFunction

Description

Notifies when the visibility of the Notification Panel changes.

Available since version Glue42 3.22

Parameters

Name Type Required Description
callback (isVisible: boolean) => any

Callback function for handling the event.

showmethod

Signature

() => Promise<void>

Description

Shows the Notification Panel.

togglemethod

Signature

() => Promise<void>

Description

Toggles the visibility of the Notification Panel.

Stateenumeration

Description

Notification state.

  • "Active" - based on configuration, the notification is either visible as a toast, or is raised only in the Notification Panel, but the user hasn't seen it yet. When the toast is hidden, the user clicks on the toast, or sees the notification in the Notification Panel, the state will change;
  • "Acknowledged" - the user has seen the notification in the Notification Panel;
  • "Closed" - the notification has either been closed from its "Close" button, or the user has clicked on it or on an action in it;
  • "Stale" - the time specified in toastExpiry has elapsed;
  • "Active"
  • "Acknowledged"
  • "Closed"
  • "Stale"

  • © 2023 Glue42
  • Home
  • Privacy policy
  • Contact Sales
  • Glue42.com
  • Tick42.com
  • Overview
  • API
  • ActionEvent
  • Configuration
  • Glue42Notification
  • Glue42NotificationAction
  • Glue42NotificationOptions
  • InteropActionSettings
  • NotificationData
  • NotificationFilter
  • NotificationPanelAPI
  • State
Navigate
Go