Skip to main content

FDC3 Openfin Notifications Listener

FDC3 Openfin notifications listener is a utility element that pipes notifications to Openfin notifications.

Use cases:

  • Display notifications in the Openfin Notifications panel

Examples​

Declaration

<openfin-notification-listener></openfin-notification-listener>

Usage

export function MyComponent() {

const interopNotificationListenerRef = useRef(null);

if (interopNotificationListenerRef.current) {
interopNotificationListenerRef.current.toastButtons = [
{
task: 'warning-button',
condition: ({details}) => details.NOTIFY_SEVERITY !== 'Warning',
action: ({details, buttonElement, toastElement}) => {
console.log({details, buttonElement, toastElement});
toastElement.close();
},
appearance: 'secondary-orange',
placeholder: 'Dismiss',
},
]

interopNotificationListenerRef.current.notificationsPlatform = {
id: 'your-platform-id',
icon: 'http://url-to-your-icon.png',
title: 'your platform title'
}
}
return (
<openfin-notification-listener
ref={interopNotificationListenerRef}
resource-name="ALL_NOTIFY_ALERT_RECORDS"
>
</openfin-notification-listener>
);
}

DOM API​

Property and attribute binding examples for Genesis Component syntax. Closing tag omitted.

Attributes​

AttributeTypeUseExample
resource-namestringThe name of the server resource that pushes notifications to the client, normally 'ALL_NOTIFY_ALERT_RECORDS'
<openfin-notification-listener resource-name="ALL_NOTIFY_ALERT_RECORDS">
toast-positionToastPositionPosition of toast notifications on the screen. Can be top-left, top-right, bottom-left, or bottom-right
<openfin-notification-listener toast-position="top-right">

Properties​

PropertyTypeUseExample
toastButtons

OpenfinToastButton[]

An array of configs for showing buttons. Buttons appear in notifications when the condition callback returns true. The action callback is called when the corresponding button is clicked
<openfin-notification-listener :toastButtons=${() => [
{
condition: ({details}) => details.NOTIFY_SEVERITY !== 'Warning',
action: ({details, buttonElement, toastElement}) => {
console.log({details, buttonElement, toastElement});
toastElement.close();
},
appearance: 'secondary-orange',
placeholder: 'Dismiss',
},
]}>
notificationsPlatformNotificationsPlatformA config object containing: id - a string, the id of your openfin application, icon - a string, the url for the icon to be displayed in the Openfin notifications panel, and title - a string, the title for of the application that is creating notifications
<openfin-notification-listener :notificationsPlatform="${() => ({
id: 'your-platform-id',
icon: 'http://url-to-your-icon.png',
title: 'your platform title'
})}">
warning

This API is in beta and is likely to change in the future.

Slots​

This component has no slots.

Parts​

This component has no parts.

Fired events​

This component doesn't fire any events.

Listened events​

This component doesn't listen to any events.