Notification
Ancestors
- None
Descendants
- None
See Also
- None
Constructors
Description
Creates a new notification that is initially hidden and not shown.
Members
Description
Gets or sets the text label for the call-to-action button. This is optional, and if left blank removes the button from the notification.
Description
Gets or sets whether the system should play a default attention system sound when the notification happens. The default for this is false. Note that sound may not play depending on the user preferences set on the operating system.
Description
Gets or sets the sub-title for the notification. This should be a very short message, less than 10 words.
Description
Gets or sets the text in the notification, this can hold, on average, up to 25 words.
Description
Gets or sets the title for the notification. This should be a very short message, less than 10 words.
Methods
Description
Dispatches the notification and shows it. Once dispatched there is no way to cancel to notification from showing. This method returns false if the notification failed to show (see requestPermission).
Returns
Type | Description |
---|---|
boolean |
Description
This method requests permission to use notifications from the underlying operating system. At the moment this always returns true unless there is an explicit ban on the application pushing notifications (perhaps it was done too often or the user has explicitly set them not to show in the system preferences). This method is static and does not require creating a notification object. It also is not required to be used prior to creating a notification.
Parameters
Name | Type | Description |
---|---|---|
callback | function | A function to callback as to the result of the request. The function will be passed on parameter that is either true or false. |