Notification Center overview

Notification Center helps users stay up-to-date and notified of events within an OpenFin application. It is home to all notifications from OpenFin applications.

The Notifications API provides application developers with a uniform way to create and organize desktop notifications as well as respond to notification events (notification clicked, closed, etc). Notifications can be displayed as toasts; they always appear in the Notification Center application. Notifications can be configured with buttons, icons, and colored indicators and further customized with your own templates. Notifications can also contain actions to help users stay up-to-date and notified of events within an OpenFin application.

Users can configure desktop level settings, such as location of notifications and notification toasts. Starting in Workspace v9.1, they can also choose to display notifications and toasts on secondary monitors. In previous versions, notifications were available only on the default monitor.

Users access Notification Center by selecting the Notification icon in the system tray.

Features

  • Notifications appear as toasts and in a centralized Notification Center app.

  • Starting in Workspace 11, users can place notifications wherever they want on their monitors. A control in Notification Center guides them through the process of custom placement, and indicates allowed positions. If the monitor changes in any way, the notification position reverts to the default, which is the lower right corner of the monitor.

    If users work with multiple monitors, custom placement can be set for each monitor.

  • If the user interacts with a notification when a linked application is closed, the application is restarted to receive any action the notification specifies.

  • You can also customize notifications in the following ways:

    • Persist notification toasts until dismissed.
    • Expire notifications by a specified date/time.
    • Attach handlers for click and close events.
    • Provide formatting of body content with Markdown and image (.ico files) support.
    • Work with custom notification templates.
    • Include a UI color theme provided by a registered Workspace Platform

Visual customization

You can customize:

  • Color and text of a banner at the top of the notification (indicator)
  • Application icon
  • Title text
  • Body content: Text with simple formatting or a list of data pairs.

With custom templates, you can change the arrangement of the basic sections and create your own layout of text, lists, and images. Refer to Customize notifications for details.

Notification behavior

You can configure:

  • Expiration, using the expires option with a date value
  • Toast type, to keep notification toasts visible on the desktop until the user interacts with them or to suppress desktop toasts altogether.
  • Buttons, to enable users to respond to a notification
  • Triggers, to respond to user actions that are not button-clicks
  • Actions, the programmatic implementation of a button or trigger

Expiration

Notifications are set to persist in the Notifications Center app by default. However, a notification can be configured to expire by adding the expires property as a NotificationOption as shown below.

create({
    ...
    expires: date;
});

Control over toasts

In addition to a notification card in the Notifications Center app, by default, a notification produces a pop-up "toast" on the desktop, which disappears after a few moments. You can change this behavior with the toast property:

  • Value "sticky" persists the notification on the desktop. Refer to Persistent notifications for more details.

  • Value "none" suppresses the toast. A card for the notification appears only in the Notification Center application. Refer to Notifications without toasts for details.

create({
    ...
    toastType: 'sticky';
});
create({
    ...
    toastType: 'none';
});

Receiving information back

You can get information back about what happens to a notification, including that it expired or that the user interacted with it in various ways. You can define buttons for simple responses or forms for more complex ones. You can also choose to get information when a user selects or closes a notification card without clicking a button.

Refer to the following articles for more information:

Application relaunch

You can configure buttons that relaunch an application if it’s closed. For example, if an application is closed and the user views a notification from it, the user can click a button in the notification to relaunch the associated application.

To permit relaunch of an application:

  1. Create a button.
  2. Configure it with the onClick property and a corresponding action.