Schedules a notification.
Once a notification is scheduled, it stays registered in the system until it is
canceled by the cancelAll
method.
The table below describes parameters included in the notification
object,
structured as follows:
{ fireDate, title, message, badge, soundName, repeatInterval }
Name | Description | Type |
---|---|---|
fireDate | A date object, specifying the time when the notification should be delivered. | date |
title | The notification title (optional). On iOS, this parameter is ignored. | string |
message | The notification message (optional). Passing a null or undefined value results in
issuing an audio-only notification (the device plays a sound file defined in the
sound parameter and the dialog box is not displayed). |
string |
badge | A badge to be shown on the iOS app icon. Passing "0" (the default value) clears the badge. TipAndroid does not support badges, therefore this setting will be ignored on Android devices. |
integer |
soundName | The name of a sound file to be played. The name must include an extension (otherwise on
iOS devices the sound will not play when Hybrid Container is in the
background). For the default system alert sound, the string "default" should be passed.
The default value of this parameter is null, i.e. no sound is played. All sound files
found in the TipFor a list of Android-supported sound file formats, see developer.android.com. For a list of iOS-supported sound file formats, see iOS Developer Library. |
string |
repeatInterval | One of the interval constants defining alert repeat interval. Please refer to the Constants section for a list of supported values. NoteOn Android, notifications can be repeated at arbitrarily chosen intervals. The delay between
notifications can be configured by setting a number of miliseconds as a value of the
On iOS, arbitrary repetition intervals are not supported. Values different from the ones defined in the Constants section are ignored. |
string |
All constant values are prefixed with the window.launchbox.LocalNotifications
prefix.
Name | Description | Type | Value |
---|---|---|---|
NO_REPEAT | Do not repeat the notification. This is the default value. | unsigned short |
0 |
YEAR_INTERVAL | Repeat the notification every year. | unsigned short |
1 |
MONTH_INTERVAL | Repeat the notification every month. | unsigned short |
2 |
DAY_INTERVAL | Repeat the notification every day. | unsigned short |
3 |
HOUR_INTERVAL | Repeat the notification every hour. | unsigned short |
4 |
MINUTE_INTERVAL | Repeat the notification every minute. | unsigned short |
5 |