schedule


Purpose

Schedules a notification.

Note

Once a notification is scheduled, it stays registered in the system until it is canceled by the cancelAll method.

Signature

schedule( notification )

Returns

This method does not return anything.

Parameters

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.

Tip

Android 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 resources/sounds directory will be packaged into the Hybrid Container's client bundle.

Tip

For 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.

Note

On 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 repeatInterval parameter. The arbitrary delay value must be greater than or equal to 100. Values different from the supported ones are ignored.

On iOS, arbitrary repetition intervals are not supported. Values different from the ones defined in the Constants section are ignored.

string

Constants

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

Related topics

LocalNotifications
Legal notice | Copyright © 2017 and Confidential to Pegasystems Inc. All rights reserved
PDN | Feedback
Advanced...