WebAPI/AlarmAPI: Difference between revisions

Jump to navigation Jump to search
m
(Update the descriptions.)
Line 42: Line 42:
* Regarding the <code>navigator.add(...)</code>, the first argument <code>date</code> can be passed by a ''Date'' object and the second argument <code>respectTimezone</code> can be passed by either <code>"honorTimezone"</code> or <code>"ignoreTimezone"</code> to specify if we need to ignore the timezone information of that ''Date'' object. When <code>"honorTimezone"</code> is passed, we will alert that application when that time happens in that timezone. I.e. if someone passes a ''Date'' object which has the timezone set to US Pacific Time and time set to 7am, we will alert the application when the time is 7am in the US Pacific timezone, even if the user is in New York and thus in US Eastern Time and it's 10am for the user. When <code>"ignoreTimezone"</code> is passed, we will ignore the timezone part of the passed in ''Date'' object. I.e. if someone passes a ''Date'' object which has the timezone set to US Pacific Time and time set to 7am, we will alert the application when the time is 7am in whatever timezone the user happens to be in. So if the user is in New York, we will alert the user when it's 7am in that timezone. Finally, the third argument <code>data</code> can be optionally specified to pass the customized JSON object data for that alarm. Note that an unique ID will be returned to refer to the added alarm.
* Regarding the <code>navigator.add(...)</code>, the first argument <code>date</code> can be passed by a ''Date'' object and the second argument <code>respectTimezone</code> can be passed by either <code>"honorTimezone"</code> or <code>"ignoreTimezone"</code> to specify if we need to ignore the timezone information of that ''Date'' object. When <code>"honorTimezone"</code> is passed, we will alert that application when that time happens in that timezone. I.e. if someone passes a ''Date'' object which has the timezone set to US Pacific Time and time set to 7am, we will alert the application when the time is 7am in the US Pacific timezone, even if the user is in New York and thus in US Eastern Time and it's 10am for the user. When <code>"ignoreTimezone"</code> is passed, we will ignore the timezone part of the passed in ''Date'' object. I.e. if someone passes a ''Date'' object which has the timezone set to US Pacific Time and time set to 7am, we will alert the application when the time is 7am in whatever timezone the user happens to be in. So if the user is in New York, we will alert the user when it's 7am in that timezone. Finally, the third argument <code>data</code> can be optionally specified to pass the customized JSON object data for that alarm. Note that an unique ID will be returned to refer to the added alarm.


* We can use <code>navigator.remove(in unsigned long id)</code> to remove an alarm that has been added in the device with a unique ID.
* We can use <code>navigator.remove(...)</code> to remove an alarm that has been added in the device with a unique ID.


* We can use <code>navigator.getAll()</code> to retrieve the information of each alarm that has been added in the device, including the unique ID, customized JSON object data and setting time (respects to the timezone or not)... etc.
* We can use <code>navigator.getAll()</code> to retrieve the information of each alarm that has been added in the device, including the unique ID, customized JSON object data and setting time (respects to the timezone or not)... etc.
Confirmed users
110

edits

Navigation menu