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.

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:

  1. 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.

  2. 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",
   "category": "News",
   "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 .


Did this page help you?