Skip to main content

Migrate notifications from a service to a system app

info

This article describes a feature that has been deprecated, and support might be removed in a future release. This article is provided to help customers who still rely on the feature.

Requirements

  • RVM 6.0+ required

  • Notifications client library 0.12.10+

Starting in RVM version 6.0, Notification Center no longer uses the service model, and is instead implemented as a system application. With Notification Center as a system application, the Notification Center is available by default and is not terminated when the last application using it closes. This enables end-users to access previously-generated notifications, which may in turn relaunch a Here COre application on the desktop.

To start developing apps that use system application notifications:

  1. Ensure that your RVM is 6.0+. The RVM updates automatically. You can check it programmatically using fin.System.getRvmInfo().

  2. Run npm update openfin-notifications to update the Notification Center client library to version 0.12.10 or later.

  3. In your application’s manifest file, remove the object in the services section that defines the notifications service.

For example, if the services parameter in the application manifest previously looked like this:

“services”:
[
{
“name”: “notifications”,
“manifestUrl”: “https://myapp-location/myapp-version/app.json”
},
{ “name”: “excel” }
]

To run with system application notifications, it should look like this:

“services”:
[
{ “name”: “excel” }
]
note

The value “excel” is included here as an example of another service and is not involved in notifications.

Best practice

The desktop owner controls the version of the Notification Center available on end-user desktops. Therefore, your application could encounter a different version than the one you developed it for.

You can use the getStatus() function to get a ProviderStatus version value of the Notification Center. If the version is lower than your application supports, you should avoid sending notifications. Refer to the release notes on the Here Core versions page for details of features added or changed in each version.

You can also raise a message to the user saying something like “MyApp requires version X of the Notification Center to use all its features. Please contact your Here™ administrator.”

Table of Contents