Class: UserNotification


(topic, frequency, identifier, message, params)
common/userNotification.js, line 56

Conditionally alerts the end user using a desktop notification.

Name Type Description
topic string

specifies a category for the notification. Topic is currently unused, but in the future it will be used to filter notifications (e.g. applying regEx's defined in config to determine which notifications are displayed). Any topic string can be specified; however "system" is the recommended topic for system notifications applicable both to end uses and to developers. "dev" is the recommended topic for notifications applicable only during development (e.g. a notification that config.json has an illegal value).

frequency string

Either "ALWAYS", "ONCE-SINCE-STARTUP", or "MAX-COUNT" to determine if alert should be displayed. Note, the frequencies are based on the number of notifications emitted from a window (as opposed to system wide.)

identifier string

uniquely identifies this specific notification message. Used when "frequency" is set to "ONCE-SINCE-STARTUP" or "MAX-COUNT"

message any

message to display in the notification. Typically a string. Finsemble's built in templating accepts and object. See src-built-in/components/notification/notification.html.

params object optional
Name Type Description
maxCount number

specifies the max number of notifications to display for specified identifier when frequency="MAX-COUNT" (default is 1)

duration number

time in milliseconds before auto-dismissing the notification (defaults to 24 hours)

url number

url for notification HTML. If not provided then the system default will be used. This url should be coded as required for OpenFin notifications (see OpenFin Documentation). Defaults to Finsemble's built-in version at "/finsemble/components/system/notification/notification.html".

UserNotification.alert("system", "ONCE-SINCE-STARTUP", "MANIFEST-Error", message);
		UserNotification.alert("dev", "ALWAYS", "Config-Error", message, { url: notificationURL, duration: 1000 * 5 });
		UserNotification.alert("dev", "MAX-COUNT", "Transport-Failure", message, { url: notificationURL, maxCount: 2 });