Notifications without toasts
You can create a notification that does not generate a toast on the desktop, but appears only within the Notification Center application. You might use this capability to avoid bombarding a user with toasts.
Note that if a user dismisses a notification in Notification Center, the notification is cleared -- that is, it is deleted entirely from Notification Center.
User story
Suppose your application or Workspace Platform is able to tell whether a user is logged in and therefore active. Your management has given you the following user stories to implement:
-
As a user, I want to log in to the application without seeing a large number of toasts that were triggered while I was logged out, so that I have a more pleasant experience with the application.
-
As a user, I want to see the notifications that arrived while I was logged out by visiting the Notification Center app, so that I can catch up on them when I am ready.
Recipe
You can use the toast
configuration option with the value none
to suppress the toast for a notification.
Code example
const notification = {
"title": "US added 138K jobs; Lower than target 185K",
"body": "After more than a decade of growth, U.S. nonfarm payrolls shrunk by 701,000, and the unemployment rate rose to 4.4%...",
"icon": "http://cdn.openfin.co/examples/notifications/company-B.png",
"priority" : 3,
"indicator": {
"color": "blue",
"text": "News Alert"
},
"toast" : "none"
}
create(notification);
More info
For information about making notification toasts that stay until they are dismissed, refer to Persistent notifications.
Updated 3 months ago