Class: Notification

Notification

new Notification(options, callbackopt, errorCallbackopt)

Creates a new Notification

Notification represents a window on OpenFin Runtime which is shown briefly to the user on the bottom-right corner of the primary monitor. A notification is typically used to alert the user of some important event which requires his or her attention.

Parameters:
Name Type Attributes Description
options fin.desktop.Notification~options

options

callback function <optional>

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

Tutorials:

Members

(inner) networkError :Object

Type:
  • Object
Properties:
Name Type Description
networkErrorCode number

The network error code from Chrome

stack string

Callstack for the error

message string

The message string from the error

(inner) onShowSuccess :Object

Type:
  • Object
Properties:
Name Type Description
httpResponseCode number

HTTP response code

(inner) options :Object

Type:
  • Object
Properties:
Name Type Description
duration number | string

Duration the notifications is shown in milliseconds

url string

The URL for the notification

message any

Any serializable JavaScript value

onShow fin.desktop.Notification~onShow

onShow

onClose fin.desktop.Notification~onClose

onClose

onDismiss fin.desktop.Notification~onDismiss

onDismiss

onClick fin.desktop.Notification~onClick

onClick

onMessage fin.desktop.Notification~onMessage

onMessage

onError fin.desktop.Notification~onError

onError

Type Definitions

onClick()

A function that is invoked when a notification is clicked.

onClose()

Invoked when the notification is closed via .close() method on the created notification instance or the by the notification itself via fin.desktop.Notification.getCurrent().close(). NOTE: this is not invoked when the notification is dismissed via a swipe. For the swipe dismissal callback see onDismiss

onDismiss()

Invoked when a the notification is dismissed by swiping it off the screen to the right. NOTE: this is no fired on a programmatic close.

onError(reason, errorObj)

Parameters:
Name Type Description
reason string

The reason of the error

errorObj fin.desktop.Notification~networkError

networkError

onMessage(message)

Parameters:
Name Type Description
message any

The message sent from the notification via sendMessageToApplication

onShow(successObj)

Parameters:
Name Type Description
successObj fin.desktop.Notification~onShowSuccess

onShowSuccess