Get started with Notification Center
OpenFin Notification Center includes an API enabling you to create and organize of uniform desktop notifications. Notifications are a great way to enhance an end-user’s experience with an OpenFin application, while ensuring that the user’s attention is drawn to pertinent and actionable tasks.
The Notification Center application organizes notifications into a central location for ease of access. Users can easily discover their notifications through search and sort (by date-time and priority) functions and configure desktop level settings (such as location). The Notification Center app ships along side your application when included in your project and is accessible via a Notification icon in the Windows System Tray.
Use this API and the Notification Center app to:
- Create persistent notification toasts
- Attach event handlers for
click
orclose
events - Launch OpenFin applications currently hidden or closed on the desktop
- Style a notification’s content with markdown and images
- Create small forms to collect user responses
System requirements
- Access to OpenFin’s CDN (https://cdn.openfin.co/)
- OpenFin Runtime 19.89.57.15
- Windows 7 or Windows 10
- OpenFin Notification Center npm library
Set up
Add the package as a dependency for your app:
> npm install openfin-notifications
Note
- The npm library is updated when the API is changed.
- Updating the npm library does not update the version of the Notification Center app.
Usage
Create a basic notification
Once your app has the library installed, you can create a simple notification with title
, body
, and category
properties. Copy and paste the following code into your app, and call it.
import {create} from 'openfin-notifications';
create({
title: 'Hello!',
body: 'This is your first notification',
category: 'Greetings',
})
For more details, refer to Buttons within a notification.
Refer to the articles under Notification styles for information about features you can use in notifications.
Updated 29 days ago