new Notification()
Defines actions of the notifications.
Methods
addAction(callback)
Add a callback that will be call when the user click on the notification.
Parameters:
Name | Type | Description |
---|---|---|
callback |
object | The callback that will be executed when the user will interact with the notification. |
addActionButton(label, callback)
Add a button to the notification.
It is possible to add an emoji in the label. The surrogates unicode must be passed because of the javascript engine version used. (https://mathiasbynens.be/notes/javascript-unicode)
The unicode format must be in the form used by Java ("\\uXXXX"). For example the usual unicode "\\u1F44D" must be "\\uD83D\\uDC4D"
Parameters:
Name | Type | Description |
---|---|---|
label |
string | The label that will be printed in the button. |
callback |
object | The callback that will be executed when the user will interact with the notification. |
discard()
Discard the notification.
show()
Show the notification to the user.