-
Notifications
You must be signed in to change notification settings - Fork 6
addAlarm
Mark Taylor edited this page Mar 31, 2014
·
7 revisions
addAlarm(what, when, showOption, extras, successCallback, failureCallback)
Allows you to add a new alarm
- what - String - the fully qualified classname of the Android Activity to be started on the alarm. Note that the helper function [getDefaultClass] (getDefaultClass) can be used to return the current activity.
- when - Date object - JavaScript Date object of when the alarm should be triggered. This should be in local timezone, the plugin will automatically convert and store as UTC.
- extras - JSON Object - Allows you to provide user defined values that will be passed to the Activity that is started as a result of the Alarm. The alarm Activity can retrieve the "extras" data using the [getActivityExtras] (getActivityExtras) method.
- showOption - String - Show Option controls how the alarm will display. See [ShowOption] (ShowOption) for possible values.
- successCallback - function - The callback which will be called if the method is successful. The callback is passed the output (see below).
- failureCallback - function - The callback which will be called if the method encounters an error. The callback is passed the output (see below).
On success no output is provided.
On failure, the provided JSONObject will contain:
- ErrorMessage - string - A textual description on why the function failed.
- [getDefaultClass] (getDefaultClass)
- [ShowOption] (ShowOption)
- [getActivityExtras] (getActivityExtras)