Skip to main content

Connect a Workspace Platform to Notification Center

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.

Starting in Here Core UI Components version 6.3, the Notification Center application supports multiple Here Core UI platform applications existing side by side on a user's desktop. The user can select a specific Here Core UI platform within Notification Center, in order to see notifications only from the applications running within that Here Core UI platform. The selected platform also applies its theme to its notifications and to the Notification Center app.

Here Core UI platforms in the Notification Center application

When a Here Core UI platform registers with Notification Center, an icon for that Here Core UI platform appears within the Notification Center app. If the user clicks the icon, the Notification Center app displays only notifications from that Here Core UI platform. If multiple Here Core UI platforms are registered, the user can select among them by clicking their respective icons. Clicking a Here Core UI platform's icon also switches the Notification Center app to use that Here Core UI platform's theme, if one is defined; if a theme is not defined for the Here Core UI platform, the default theme is used.

An All icon displays all notifications, including any from notification providers that are not Here Core UI platforms, and applies the default theme. The current selection (All or a Here Core UI platform) is indicated by an underline beneath the selected icon.

If the Notification Center app is launched from a particular Here Core UI platform, then that application's theme, icon, and filter are automatically selected. If the Notification Center app is launched independently of a Here Core UI platform, then the default theme and All icon are selected, with no platform filter applied; the Here Core UI platforms available are those that are already running when the Notification Center app starts.

The theme applied by a Here Core UI platform when invoking the Notification Center app is the same one it applies to all Here Core UI components; in this way, the colors are consistent across all Here Core UI components themed by the same Here Core UI platform, with nothing unique to Notification Center.

Here Core UI platform selection and toasts

Although selecting a particular Here Core UI platform within the Notification Center application filters the notifications that are shown there, this selection has no effect on the creation and display of notification toasts. All toasts generated by all notification providers are displayed on the desktop, regardless of the selected Here Core UI platform in the Notification Center app.

Notification toasts inherit the theme of the Here Core UI platform that generates them. Toasts generated by notification providers that are not Here Core UI platforms use the default theme for the desktop.

Register a Here Core UI platform with Notification Center

If you have already created a Here Core UI platform application, for example, to provide content to Store or commands and search results to Home, then exposing it in Notification Center is relatively straightforward.

The following discussion assumes that you have already initialized a Here Core UI platform, optionally with a color theme. You can then register it with Notification Center via the following steps:

  1. Import the Notification Center API via the Workspace SDK.

  2. Define the information about the Here Core UI platform needed by Notification Center.

    • A unique identifier

    • A user-friendly title

    • A URL for an icon

  3. Register the Here Core UI platform with Notification Center.

  4. Create notifications in your application, same as any other notification provider.

  5. When the Here Core UI platform no longer needs to appear in the Notification Center (such as on exit), deregister it.

Import the Notification Center API via the Workspace SDK

You do not need to separately import both the Notification Center API and the Workspace API. You can access the Notification Center API via the Workspace SDK:

import * as Notifications from "@openfin/workspace/notifications";
import type { NotificationsPlatform } from "@openfin/workspace/notifications";

Define and register the Workspace Platform application

// Import as above
const platform: NotificationsPlatform =
{
id: "UNIQUE-PROVIDER-ID",
title: "Custom Notification Platform",
icon: "https://example.com/favicon.ico",
};
Notifications.registerPlatform(platform);

You do not need to explicitly pass the theme when registering with Notification Center, given that you are registering an application that already has a Here Core UI platform theme defined.

Create notifications

Refer to Get started with Notification Center and related articles for information about features you can use when creating notifications.

Deregister the Here Core UI platform

//On some event, etc., it's time to deregister
Notifications.deregister("UNIQUE-PROVIDER-ID");