Skip to main content

FDC3 Openfin notifications listener

This 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

@customElement({
name: 'my-element',
template: html`
<openfin-notification-listener
resource-name="ALL_NOTIFY_ALERT_RECORDS",
:notificationsPlatform="${() => ({
id: 'your-platform-id',
icon: 'http://url-to-your-icon.png',
title: 'your platform title'
})}"
:toastButtons="${(): OpenfinToastButton[] => [
{
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',
},
]}"
></openfin-notification-listener>
`,
})
export class MyElement extends GenesisElement {}

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">

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.