<li><a href="#manage">Managing Alarms</a></li>
<li><a href="#launch">Launching Applications with Alarms</a></li>
<li><a href="#check">Checking for Alarm Events</a></li>
+ <li><a href="#notification">Managing Alarm notifications</a></li>
</ul>
<p class="toc-title">Related Info</p>
<ul class="toc">
<h1>Alarms</h1>
<p>Tizen enables you to schedule an application to be run at a specific time. When an alarm is triggered, the application is launched (unless it is already running).</p>
-
-<p>The Alarm API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. All mandatory APIs are supported on the Tizen Emulators.</p>
-
+
+<p>The Alarm API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. All mandatory APIs are supported on the Tizen Emulators.</p>
+
<p>The main features of the Alarm API include:</p>
<ul>
- <li>Alarm management
+ <li>Alarm management
<p>You can <a href="#manage">manage alarms</a> by creating and deleting them. You can also obtain a list of all existing alarms on the device.</p></li>
<li>Application launches with alarms
<p>You can set an alarm to <a href="#launch">launch an application when triggered</a>.</p></li>
- <li>Alarm events
+ <li>Alarm events
<p>You can <a href="#check">retrieve information about the next alarm event</a>.</p> </li>
+ <li>Alarm notifications management
+ <p>You can manage alarm notifications which will <a href="#notification">trigger notifications at given time</a>. You can also obtain notifications, which were passed to method adding alarm notifications.</p></li>
</ul>
<h2 id="prerequisites">Prerequisites</h2>
<tizen:privilege name="http://tizen.org/privilege/alarm"/>
</pre>
-
<h2 id="manage" name="manage">Managing Alarms</h2>
<p>Both relative and absolute alarms are available: the relative alarm is triggered after a specified delay from the moment it is created, while an absolute alarm is triggered at a specified time and date. You can also create a recurring alarm that is repeated after a specified period of time, or on the given days of the week at a defined time.</p>
</pre></li>
</ul></li>
- <li><p>To delete an alarm, use the <code>remove()</code> method with the alarm ID:</p>
+ <li id="removeAlarm"><p>To delete an alarm, use the <code>remove()</code> method with the alarm ID:</p>
<pre class="prettyprint">
/* First add created alarm to the device */
/* Tizen alias ID is deprecated since Tizen 2.3.1 */
</pre></li>
</ol>
+<h2 id="notification" name="notification">Managing Alarm notifications</h2>
+<p>This feature is supported in mobile and wearable applications only.</p>
+<p>You can manage alarm notifications. Alarm notification is an alarm, which after triggering will automatically post <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/notification.html#Notification">notification</a>. You can add both types of alarms: <code>AlarmAbsolute</code> (in <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/alarm.html#AlarmAbsolute">mobile</a>, <a href="../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/alarm.html#AlarmAbsolute">wearable</a> applications) and <code>AlarmRelative</code> (in <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/alarm.html#AlarmRelative">mobile</a>, <a href="../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/alarm.html#AlarmRelative">wearable</a> applications).
+Notification will be shown in the status bar on the device</p>
+In this example we will create alarm notification with alarm type <code>AlarmRelative</code> and notification type <code>StatusNotification</code>. The notification will be posted after the alarm is triggered. This alarm will also be periodic.
+<ol>
+ <li><p>Create </code>AlarmRelative</code> object:</p>
+<pre class="prettyprint">
+/* Alarm will trigger after 3 seconds and repeat every 3 hours */
+var alarm = new tizen.AlarmRelative(3, 3 * tizen.alarm.PERIOD_HOUR);
+</pre></li>
+ <li><p>Create <code>ApplicationControl</code> and <code>StatusNotificationInit</code> needed for <code>StatusNotification</code>:</p>
+<pre class="prettyprint">
+/* Create ApplicationControl object */
+var appControl = new tizen.ApplicationControl(
+ "http://tizen.org/appcontrol/operation/default",
+ null,
+ "image/jpg",
+ null);
+/* You can add additional attibutes to the dictionary */
+var notificationDict =
+{
+ content: "This is a simple notification's content.",
+ vibration : true,
+ appId: tizen.application.getCurrentApplication().appInfo.id,
+ appControl : appControl,
+};
+/* Create StatusNotification object */
+var notification = new tizen.StatusNotification("SIMPLE", "Simple notification's title", notificationDict);
+</pre></li>
+ <li><p>Add alarm notification:</p>
+<pre class="prettyprint">
+/* Add created alarm to the storage */
+tizen.alarm.addAlarmNotification(alarm, notification);
+</pre></li>
+ <li><p>You can get added notification before the alarm goes off:</p>
+<pre class="prettyprint">
+/* Obtain notification object */
+var noti = tizen.alarm.getAlarmNotification(alarm.id);
+console.log("Notification title: " + noti.title + ", content: " + noti.content);
+</pre></li>
+You can also <a href="#removeAlarm">remove alarm notification</a> with method <code>tizen.alarm.remove()</code>.
+ </ol>
+
<script type="text/javascript" src="../../scripts/jquery.zclip.min.js"></script>
<script type="text/javascript" src="../../scripts/showhide.js"></script>
</div></div></div>
<tr>
<td><a href="#AlarmManager">AlarmManager</a></td>
<td>void <a href="#AlarmManager::add">add</a> (<a href="#Alarm">Alarm</a> alarm, <a href="application.html#ApplicationId">ApplicationId</a> applicationId, optional <a href="application.html#ApplicationControl">ApplicationControl</a>? appControl)<br>
+ void <a href="#AlarmManager::addAlarmNotification">addAlarmNotification</a> (<a href="#Alarm">Alarm</a> alarm, <a href="notification.html#Notification">Notification</a> notification)<br>
void <a href="#AlarmManager::remove">remove</a> (<a href="#AlarmId">AlarmId</a> id)<br>
void <a href="#AlarmManager::removeAll">removeAll</a> ()<br>
<a href="#Alarm">Alarm</a> <a href="#AlarmManager::get">get</a> (<a href="#AlarmId">AlarmId</a> id)<br>
+ <a href="notification.html#Notification">Notification</a> <a href="#AlarmManager::getAlarmNotification">getAlarmNotification</a> (<a href="#AlarmId">AlarmId</a> id)<br>
<a href="#Alarm">Alarm</a>[] <a href="#AlarmManager::getAll">getAll</a> ()</td>
</tr>
<tr>
void add(<a href="#Alarm">Alarm</a> alarm, <a href="application.html#ApplicationId">ApplicationId</a> applicationId, optional <a href="application.html#ApplicationControl">ApplicationControl</a>? appControl) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+ void addAlarmNotification(<a href="#Alarm">Alarm</a> alarm, <a href="notification.html#Notification">Notification</a> notification) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
void remove(<a href="#AlarmId">AlarmId</a> id) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
void removeAll() raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
<a href="#Alarm">Alarm</a> get(<a href="#AlarmId">AlarmId</a> id) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+ <a href="notification.html#Notification">Notification</a> getAlarmNotification(<a href="#AlarmId">AlarmId</a> id) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
<a href="#Alarm">Alarm</a>[] getAll() raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
};</pre>
<p><span class="version">
</pre>
</div>
</dd>
+<dt class="method" id="AlarmManager::addAlarmNotification">
+<a class="backward-compatibility-anchor" name="::Alarm::AlarmManager::addAlarmNotification"></a><code><b><span class="methodName">addAlarmNotification</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Adds an alarm notification to the storage.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">void addAlarmNotification(<a href="#Alarm">Alarm</a> alarm, <a href="notification.html#Notification">Notification</a> notification);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 4.0
+ </p>
+<div class="description">
+ <p>
+Adds an alarm which causes notification to appear instead of launching an AppControl.
+For more information about the notification, see <a href="notification.html">The Notification API</a>.
+ </p>
+ </div>
+<p><span class="privilegelevel">
+ Privilege level: </span>
+ public
+ </p>
+<p><span class="privilege">
+ Privilege: </span>
+ http://tizen.org/privilege/alarm
+ </p>
+<p><span class="privilege">
+ Privilege: </span>
+ http://tizen.org/privilege/notification
+ </p>
+<p class="warning"><b>Warning:</b>
+ Since Tizen 4.0 constructor AlarmAbsolute(Date date, long period) is deprecated thus it is <b>not</b> allowed to pass <em>AlarmAbsolute</em> created from such constructor.
+ </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">alarm</span>:
+ An alarm to add. It can be either <em>AlarmRelative</em> or <em>AlarmAbsolute</em>.
+ </li>
+ <li class="param">
+<span class="name">notification</span>:
+ Notification to be added to the alarm.
+ </li>
+ </ul>
+</div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+ <ul class="exception"><li>WebAPIException<ul>
+<li class="list"><p>
+ with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
+ </p></li>
+<li class="list"><p>
+ with error type InvalidValuesError, if any input parameter does not contain a valid value (e.g. recursive <em>AlarmAbsolute</em>, created from constructor AlarmAbsolute(Date date, long period) is passed).
+ </p></li>
+<li class="list"><p>
+ with error type SecurityError, if the application does not have the privilege to call this method.
+ </p></li>
+<li class="list"><p>
+ with error type AbortError, if any other error occurs.
+ </p></li>
+</ul>
+</li></ul>
+ </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint">
+/* Triggers an alarm notification on a given date/time */
+var alarm = new tizen.AlarmAbsolute(new Date(2017, 10, 4, 8, 0));
+var notificationDict =
+{
+ content: "This is a simple notification.",
+ iconPath: "images/image1.jpg",
+ soundPath: "music/Over the horizon.mp3"
+};
+var notification = new tizen.StatusNotification("SIMPLE", "Simple notification", notificationDict);
+
+tizen.alarm.addAlarmNotification(alarm, notification);
+console.log("Alarm notification added with id: " + alarm.id);
+</pre>
+</div>
+<div class="output">
+<span class="title"><p>Output example:</p></span><pre> Alarm notification added with id: 660485805
+ </pre>
+</div>
+</dd>
<dt class="method" id="AlarmManager::remove">
<a class="backward-compatibility-anchor" name="::Alarm::AlarmManager::remove"></a><code><b><span class="methodName">remove</span></b></code>
</dt>
</pre>
</div>
</dd>
+<dt class="method" id="AlarmManager::getAlarmNotification">
+<a class="backward-compatibility-anchor" name="::Alarm::AlarmManager::getAlarmNotification"></a><code><b><span class="methodName">getAlarmNotification</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Gets the notification to be posted when an alarm is triggered. Returned <em>Notification</em> is exactly the same like passed to method <em>addAlarmNotification</em>.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint"><a href="notification.html#Notification">Notification</a> getAlarmNotification(<a href="#AlarmId">AlarmId</a> id);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 4.0
+ </p>
+<p><span class="privilegelevel">
+ Privilege level: </span>
+ public
+ </p>
+<p><span class="privilege">
+ Privilege: </span>
+ http://tizen.org/privilege/alarm
+ </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">id</span>:
+ ID which uniquely identifies a scheduled alarm.
+ </li>
+ </ul>
+</div>
+<div class="returntype">
+<p><span class="return">Return value:</span></p>
+ The notification to be posted when the alarm is triggered.
+ </div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+ <ul class="exception"><li>WebAPIException<ul>
+<li class="list"><p>
+ with error type NotFoundError, if alarm with given identifier was already triggered or alarm identifier cannot be found in the storage.
+ </p></li>
+<li class="list"><p>
+ with error type SecurityError, if the application does not have the privilege to call this method.
+ </p></li>
+<li class="list"><p>
+ with error type AbortError, if any other error occurs.
+ </p></li>
+</ul>
+</li></ul>
+ </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint">
+var date = new Date();
+date.setHours(date.getHours() + 1);
+var alarm = new tizen.AlarmAbsolute(date);
+
+var notificationDict =
+{
+ content: "This is a simple notification.",
+ iconPath: "images/image1.jpg",
+ soundPath: "music/Over the horizon.mp3"
+};
+var notification = new tizen.StatusNotification("SIMPLE", "Simple notification", notificationDict);
+
+/* Adds an alarm */
+tizen.alarm.addAlarmNotification(alarm, notification);
+
+/* Gets a notification */
+var notification = tizen.alarm.getAlarmNotification(alarm.id);
+console.log("Notification title: " + notification.title + ", content: " + notification.content);
+</pre>
+</div>
+<div class="output">
+<span class="title"><p>Output example:</p></span><pre> Notification title: Simple notification, content: This is a simple notification.
+ </pre>
+</div>
+</dd>
<dt class="method" id="AlarmManager::getAll">
<a class="backward-compatibility-anchor" name="::Alarm::AlarmManager::getAll"></a><code><b><span class="methodName">getAll</span></b></code>
</dt>
If a <em>period</em> is provided, the alarm keeps triggering for the given interval. If the <em>daysOfTheWeek</em> array is not empty, the alarm triggers every week, for the given days, at the time defined by the <em>date</em> attribute.
</p>
</div>
+<p class="warning"><b>Warning:</b>
+ Since Tizen 4.0 constructor AlarmAbsolute(Date date, long period) is deprecated.
+ </p>
<div class="example">
<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint">
/* Gets the current application ID */
tizen.alarm.add(alarm1, appId);
/* Sets an alarm on January 1st 2014 08:00, repeating every 2 days */
+/* Since Tizen 4.0 below constructor is deprecated */
var alarm2 = new tizen.AlarmAbsolute(date, 2 * tizen.alarm.PERIOD_DAY);
tizen.alarm.add(alarm2, appId);
1.0
</p>
</li>
-<li class="attribute" id="AlarmAbsolute::period">
+<li class="attribute deprecated" id="AlarmAbsolute::period">
<span class="attrName"><span class="readonly"> readonly
</span><span class="type">long </span><span class="name">period</span><span class="optional"> [nullable]</span></span><div class="brief">
An attribute to store the duration in seconds between each trigger of the alarm.
</div>
+<p class="deprecated"><b>Deprecated.</b>
+ Since Tizen 4.0 constructor AlarmAbsolute(Date date, long period) is deprecated, thus this attribute should not be used.
+ </p>
<div class="description">
<p>
By default, this attribute is set to <var>null</var>, indicating that this alarm does not repeat.
void add(<a href="#Alarm">Alarm</a> alarm, <a href="application.html#ApplicationId">ApplicationId</a> applicationId, optional <a href="application.html#ApplicationControl">ApplicationControl</a>? appControl) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+ void addAlarmNotification(<a href="#Alarm">Alarm</a> alarm, <a href="notification.html#Notification">Notification</a> notification) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
void remove(<a href="#AlarmId">AlarmId</a> id) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
void removeAll() raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
<a href="#Alarm">Alarm</a> get(<a href="#AlarmId">AlarmId</a> id) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+ <a href="notification.html#Notification">Notification</a> getAlarmNotification(<a href="#AlarmId">AlarmId</a> id) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
<a href="#Alarm">Alarm</a>[] getAll() raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
};
<tr>
<td><a href="#AlarmManager">AlarmManager</a></td>
<td>void <a href="#AlarmManager::add">add</a> (<a href="#Alarm">Alarm</a> alarm, <a href="application.html#ApplicationId">ApplicationId</a> applicationId, optional <a href="application.html#ApplicationControl">ApplicationControl</a>? appControl)<br>
+ void <a href="#AlarmManager::addAlarmNotification">addAlarmNotification</a> (<a href="#Alarm">Alarm</a> alarm, <a href="notification.html#Notification">Notification</a> notification)<br>
void <a href="#AlarmManager::remove">remove</a> (<a href="#AlarmId">AlarmId</a> id)<br>
void <a href="#AlarmManager::removeAll">removeAll</a> ()<br>
<a href="#Alarm">Alarm</a> <a href="#AlarmManager::get">get</a> (<a href="#AlarmId">AlarmId</a> id)<br>
+ <a href="notification.html#Notification">Notification</a> <a href="#AlarmManager::getAlarmNotification">getAlarmNotification</a> (<a href="#AlarmId">AlarmId</a> id)<br>
<a href="#Alarm">Alarm</a>[] <a href="#AlarmManager::getAll">getAll</a> ()</td>
</tr>
<tr>
void add(<a href="#Alarm">Alarm</a> alarm, <a href="application.html#ApplicationId">ApplicationId</a> applicationId, optional <a href="application.html#ApplicationControl">ApplicationControl</a>? appControl) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+ void addAlarmNotification(<a href="#Alarm">Alarm</a> alarm, <a href="notification.html#Notification">Notification</a> notification) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
void remove(<a href="#AlarmId">AlarmId</a> id) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
void removeAll() raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
<a href="#Alarm">Alarm</a> get(<a href="#AlarmId">AlarmId</a> id) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+ <a href="notification.html#Notification">Notification</a> getAlarmNotification(<a href="#AlarmId">AlarmId</a> id) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
<a href="#Alarm">Alarm</a>[] getAll() raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
};</pre>
<p><span class="version">
</pre>
</div>
</dd>
+<dt class="method" id="AlarmManager::addAlarmNotification">
+<a class="backward-compatibility-anchor" name="::Alarm::AlarmManager::addAlarmNotification"></a><code><b><span class="methodName">addAlarmNotification</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Adds an alarm notification to the storage.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">void addAlarmNotification(<a href="#Alarm">Alarm</a> alarm, <a href="notification.html#Notification">Notification</a> notification);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 4.0
+ </p>
+<div class="description">
+ <p>
+Adds an alarm which causes notification to appear instead of launching an AppControl.
+For more information about the notification, see <a href="notification.html">The Notification API</a>.
+ </p>
+ </div>
+<p><span class="privilegelevel">
+ Privilege level: </span>
+ public
+ </p>
+<p><span class="privilege">
+ Privilege: </span>
+ http://tizen.org/privilege/alarm
+ </p>
+<p><span class="privilege">
+ Privilege: </span>
+ http://tizen.org/privilege/notification
+ </p>
+<p class="warning"><b>Warning:</b>
+ Since Tizen 4.0 constructor AlarmAbsolute(Date date, long period) is deprecated thus it is <b>not</b> allowed to pass <em>AlarmAbsolute</em> created from such constructor.
+ </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">alarm</span>:
+ An alarm to add. It can be either <em>AlarmRelative</em> or <em>AlarmAbsolute</em>.
+ </li>
+ <li class="param">
+<span class="name">notification</span>:
+ Notification to be added to the alarm.
+ </li>
+ </ul>
+</div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+ <ul class="exception"><li>WebAPIException<ul>
+<li class="list"><p>
+ with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
+ </p></li>
+<li class="list"><p>
+ with error type InvalidValuesError, if any input parameter does not contain a valid value (e.g. recursive <em>AlarmAbsolute</em>, created from constructor AlarmAbsolute(Date date, long period) is passed).
+ </p></li>
+<li class="list"><p>
+ with error type SecurityError, if the application does not have the privilege to call this method.
+ </p></li>
+<li class="list"><p>
+ with error type AbortError, if any other error occurs.
+ </p></li>
+</ul>
+</li></ul>
+ </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint">
+/* Triggers an alarm notification on a given date/time */
+var alarm = new tizen.AlarmAbsolute(new Date(2017, 10, 4, 8, 0));
+var notificationDict =
+{
+ content: "This is a simple notification.",
+ iconPath: "images/image1.jpg",
+ soundPath: "music/Over the horizon.mp3"
+};
+var notification = new tizen.StatusNotification("SIMPLE", "Simple notification", notificationDict);
+
+tizen.alarm.addAlarmNotification(alarm, notification);
+console.log("Alarm notification added with id: " + alarm.id);
+</pre>
+</div>
+<div class="output">
+<span class="title"><p>Output example:</p></span><pre> Alarm notification added with id: 660485805
+ </pre>
+</div>
+</dd>
<dt class="method" id="AlarmManager::remove">
<a class="backward-compatibility-anchor" name="::Alarm::AlarmManager::remove"></a><code><b><span class="methodName">remove</span></b></code>
</dt>
</pre>
</div>
</dd>
+<dt class="method" id="AlarmManager::getAlarmNotification">
+<a class="backward-compatibility-anchor" name="::Alarm::AlarmManager::getAlarmNotification"></a><code><b><span class="methodName">getAlarmNotification</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Gets the notification to be posted when an alarm is triggered. Returned <em>Notification</em> is exactly the same like passed to method <em>addAlarmNotification</em>.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint"><a href="notification.html#Notification">Notification</a> getAlarmNotification(<a href="#AlarmId">AlarmId</a> id);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 4.0
+ </p>
+<p><span class="privilegelevel">
+ Privilege level: </span>
+ public
+ </p>
+<p><span class="privilege">
+ Privilege: </span>
+ http://tizen.org/privilege/alarm
+ </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">id</span>:
+ ID which uniquely identifies a scheduled alarm.
+ </li>
+ </ul>
+</div>
+<div class="returntype">
+<p><span class="return">Return value:</span></p>
+ The notification to be posted when the alarm is triggered.
+ </div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+ <ul class="exception"><li>WebAPIException<ul>
+<li class="list"><p>
+ with error type NotFoundError, if alarm with given identifier was already triggered or alarm identifier cannot be found in the storage.
+ </p></li>
+<li class="list"><p>
+ with error type SecurityError, if the application does not have the privilege to call this method.
+ </p></li>
+<li class="list"><p>
+ with error type AbortError, if any other error occurs.
+ </p></li>
+</ul>
+</li></ul>
+ </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint">
+var date = new Date();
+date.setHours(date.getHours() + 1);
+var alarm = new tizen.AlarmAbsolute(date);
+
+var notificationDict =
+{
+ content: "This is a simple notification.",
+ iconPath: "images/image1.jpg",
+ soundPath: "music/Over the horizon.mp3"
+};
+var notification = new tizen.StatusNotification("SIMPLE", "Simple notification", notificationDict);
+
+/* Adds an alarm */
+tizen.alarm.addAlarmNotification(alarm, notification);
+
+/* Gets a notification */
+var notification = tizen.alarm.getAlarmNotification(alarm.id);
+console.log("Notification title: " + notification.title + ", content: " + notification.content);
+</pre>
+</div>
+<div class="output">
+<span class="title"><p>Output example:</p></span><pre> Notification title: Simple notification, content: This is a simple notification.
+ </pre>
+</div>
+</dd>
<dt class="method" id="AlarmManager::getAll">
<a class="backward-compatibility-anchor" name="::Alarm::AlarmManager::getAll"></a><code><b><span class="methodName">getAll</span></b></code>
</dt>
If a <em>period</em> is provided, the alarm keeps triggering for the given interval. If the <em>daysOfTheWeek</em> array is not empty, the alarm triggers every week, for the given days, at the time defined by the <em>date</em> attribute.
</p>
</div>
+<p class="warning"><b>Warning:</b>
+ Since Tizen 4.0 constructor AlarmAbsolute(Date date, long period) is deprecated.
+ </p>
<div class="example">
<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint">
/* Gets the current application ID */
tizen.alarm.add(alarm1, appId);
/* Sets an alarm on January 1st 2014 08:00, repeating every 2 days */
+/* Since Tizen 4.0 below constructor is deprecated */
var alarm2 = new tizen.AlarmAbsolute(date, 2 * tizen.alarm.PERIOD_DAY);
tizen.alarm.add(alarm2, appId);
1.0
</p>
</li>
-<li class="attribute" id="AlarmAbsolute::period">
+<li class="attribute deprecated" id="AlarmAbsolute::period">
<span class="attrName"><span class="readonly"> readonly
</span><span class="type">long </span><span class="name">period</span><span class="optional"> [nullable]</span></span><div class="brief">
An attribute to store the duration in seconds between each trigger of the alarm.
</div>
+<p class="deprecated"><b>Deprecated.</b>
+ Since Tizen 4.0 constructor AlarmAbsolute(Date date, long period) is deprecated, thus this attribute should not be used.
+ </p>
<div class="description">
<p>
By default, this attribute is set to <var>null</var>, indicating that this alarm does not repeat.
void add(<a href="#Alarm">Alarm</a> alarm, <a href="application.html#ApplicationId">ApplicationId</a> applicationId, optional <a href="application.html#ApplicationControl">ApplicationControl</a>? appControl) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+ void addAlarmNotification(<a href="#Alarm">Alarm</a> alarm, <a href="notification.html#Notification">Notification</a> notification) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
void remove(<a href="#AlarmId">AlarmId</a> id) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
void removeAll() raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
<a href="#Alarm">Alarm</a> get(<a href="#AlarmId">AlarmId</a> id) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+ <a href="notification.html#Notification">Notification</a> getAlarmNotification(<a href="#AlarmId">AlarmId</a> id) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
<a href="#Alarm">Alarm</a>[] getAll() raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
};