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 | ||
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 |
(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 | |
onClose |
fin.desktop.Notification~onClose | |
onDismiss |
fin.desktop.Notification~onDismiss | |
onClick |
fin.desktop.Notification~onClick | |
onMessage |
fin.desktop.Notification~onMessage | |
onError |
fin.desktop.Notification~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 |
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 |