PS3: Studio content reviewed.
PS4: Removed extra whitespace
Change-Id: I1e856333035b2c906a49ca04b2afd323134a6153
Signed-off-by: Piotr Kosko <p.kosko@samsung.com>
<h2 id="notification" name="notification">Managing Alarm Notifications in Mobile and Wearable Applications</h2>
<p>Alarm notification is an alarm which, when triggered, automatically posts a <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/notification.html#Notification">notification</a>. You can create alarm notifications with both <code>AlarmAbsolute</code> (in <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/alarm.html#AlarmAbsolute">mobile</a> and <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> and <a href="../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/alarm.html#AlarmRelative">wearable</a> applications) alarm types. The notification is shown in the status bar on the device.</p>
-<p>To create an alarm notification with the <code>AlarmRelative</code> alarm type and <code>StatusNotification</code> notification type, where the alarm is periodic and the notification is posted after the alarm is triggered:</p>
+<p>To create an alarm notification with the <code>AlarmRelative</code> alarm type and <code>UserNotification</code> notification type, where the alarm is periodic and the notification is posted after the alarm is triggered:</p>
<ol>
<li><p>Create an <code>AlarmRelative</code> object:</p>
<pre class="prettyprint">
/* Alarm triggers after 3 seconds and repeats every 3 hours */
var alarm = new tizen.AlarmRelative(3, 3 * tizen.alarm.PERIOD_HOUR);
</pre></li>
- <li><p>Create the <code>ApplicationControl</code> and <code>StatusNotificationInit</code> instances needed for the <code>StatusNotification</code> notification type:</p>
+ <li><p>Create the <code>ApplicationControl</code> and <code>UserNotificationInit</code> instances needed for the <code>UserNotification</code> notification type:</p>
<pre class="prettyprint">
/* Create ApplicationControl object */
var appControl = new tizen.ApplicationControl('http://tizen.org/appcontrol/operation/default',
/* You can add additional attibutes to the notification dictionary */
var notificationDict = {
content: 'This is a simple notification\'s content.',
- vibration: true,
- appId: tizen.application.getCurrentApplication().appInfo.id,
- appControl: appControl,
+ actions: {
+ vibration: true,
+ appId: tizen.application.getCurrentApplication().appInfo.id,
+ appControl: appControl
+ },
};
-/* Create StatusNotification object */
-var notification = new tizen.StatusNotification('SIMPLE', 'Simple notification\'s title',
- notificationDict);
+/* Create UserNotification object */
+var notification = new tizen.UserNotification('SIMPLE', 'Simple notification\'s title',
+ notificationDict);
</pre></li>
<li><p>Add the alarm notification:</p>
<pre class="prettyprint">
</script>
</body>
-</html>
\ No newline at end of file
+</html>
</tr>
<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>
+<td>
+<div>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)</div>
+<div>void <a href="#AlarmManager::addAlarmNotification">addAlarmNotification</a> (<a href="#Alarm">Alarm</a> alarm, <a href="notification.html#Notification">Notification</a> notification)</div>
+<div>void <a href="#AlarmManager::remove">remove</a> (<a href="#AlarmId">AlarmId</a> id)</div>
+<div>void <a href="#AlarmManager::removeAll">removeAll</a> ()</div>
+<div>
+<a href="#Alarm">Alarm</a> <a href="#AlarmManager::get">get</a> (<a href="#AlarmId">AlarmId</a> id)</div>
+<div>
+<a href="notification.html#UserNotification">UserNotification</a> <a href="#AlarmManager::getAlarmNotification">getAlarmNotification</a> (<a href="#AlarmId">AlarmId</a> id)</div>
+<div>
+<a href="#Alarm">Alarm</a>[] <a href="#AlarmManager::getAll">getAll</a> ()</div>
+</td>
</tr>
<tr>
<td><a href="#Alarm">Alarm</a></td>
</tr>
<tr>
<td><a href="#AlarmRelative">AlarmRelative</a></td>
-<td>long? <a href="#AlarmRelative::getRemainingSeconds">getRemainingSeconds</a> ()</td>
+<td><div>long? <a href="#AlarmRelative::getRemainingSeconds">getRemainingSeconds</a> ()</div></td>
</tr>
<tr>
<td><a href="#AlarmAbsolute">AlarmAbsolute</a></td>
-<td>Date? <a href="#AlarmAbsolute::getNextScheduledDate">getNextScheduledDate</a> ()</td>
+<td><div>Date? <a href="#AlarmAbsolute::getNextScheduledDate">getNextScheduledDate</a> ()</div></td>
</tr>
</tbody>
</table>
<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="notification.html#UserNotification">UserNotification</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>
<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 =
+var notificationGroupDict =
{
- content: "This is a simple notification.",
- iconPath: "images/image1.jpg",
- soundPath: "music/Over the horizon.mp3"
+ content: "This is a simple user notification.",
+ actions:
+ {
+ soundPath: "music/Over the horizon.mp3",
+ vibration: true
+ }
};
-var notification = new tizen.StatusNotification("SIMPLE", "Simple notification", notificationDict);
+
+var notification = new tizen.UserNotification("SIMPLE", "User notification", notificationGroupDict);
tizen.alarm.addAlarmNotification(alarm, notification);
console.log("Alarm notification added with id: " + alarm.id);
</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>.
+ Gets the notification to be posted when an alarm is triggered. Returned <em>UserNotification</em> contains exactly the same data 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);
+<div class="synopsis"><pre class="signature prettyprint"><a href="notification.html#UserNotification">UserNotification</a> getAlarmNotification(<a href="#AlarmId">AlarmId</a> id);
</pre></div>
<p><span class="version">
Since: </span>
Privilege: </span>
http://tizen.org/privilege/alarm
</p>
+<p><span class="remark"> Remark : </span>
+ This method is designed to return only <a href="notification.html#UserNotification">UserNotification</a> objects,
+even if the added alarm was using <a href="notification.html#StatusNotification">StatusNofitication</a>.
+ </p>
<div class="parameters">
<p><span class="param">Parameters:</span></p>
<ul>
date.setHours(date.getHours() + 1);
var alarm = new tizen.AlarmAbsolute(date);
-var notificationDict =
+var notificationGroupDict =
{
- content: "This is a simple notification.",
- iconPath: "images/image1.jpg",
- soundPath: "music/Over the horizon.mp3"
+ content: "This is a simple user notification.",
+ actions:
+ {
+ soundPath: "music/Over the horizon.mp3",
+ vibration: true
+ }
};
-var notification = new tizen.StatusNotification("SIMPLE", "Simple notification", notificationDict);
+
+var notification = new tizen.UserNotification("SIMPLE", "User notification", notificationGroupDict);
/* 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);
+console.log("User 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.
+<span class="title"><p>Output example:</p></span><pre> User Notification title: User notification, content: This is a simple user notification.
</pre>
</div>
</dd>
interface AlarmAbsolute : <a href="#Alarm">Alarm</a> {
readonly attribute Date date;
- readonly attribute long? period;
-
readonly attribute <a href="#ByDayValue">ByDayValue</a>[] daysOfTheWeek;
Date? getNextScheduledDate() raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
interface AlarmAbsolute : <a href="#Alarm">Alarm</a> {
readonly attribute Date date;
- readonly attribute long? period;
-
readonly attribute <a href="#ByDayValue">ByDayValue</a>[] daysOfTheWeek;
Date? getNextScheduledDate() raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
</tr>
<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>
+<td>
+<div>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)</div>
+<div>void <a href="#AlarmManager::addAlarmNotification">addAlarmNotification</a> (<a href="#Alarm">Alarm</a> alarm, <a href="notification.html#Notification">Notification</a> notification)</div>
+<div>void <a href="#AlarmManager::remove">remove</a> (<a href="#AlarmId">AlarmId</a> id)</div>
+<div>void <a href="#AlarmManager::removeAll">removeAll</a> ()</div>
+<div>
+<a href="#Alarm">Alarm</a> <a href="#AlarmManager::get">get</a> (<a href="#AlarmId">AlarmId</a> id)</div>
+<div>
+<a href="notification.html#UserNotification">UserNotification</a> <a href="#AlarmManager::getAlarmNotification">getAlarmNotification</a> (<a href="#AlarmId">AlarmId</a> id)</div>
+<div>
+<a href="#Alarm">Alarm</a>[] <a href="#AlarmManager::getAll">getAll</a> ()</div>
+</td>
</tr>
<tr>
<td><a href="#Alarm">Alarm</a></td>
</tr>
<tr>
<td><a href="#AlarmRelative">AlarmRelative</a></td>
-<td>long? <a href="#AlarmRelative::getRemainingSeconds">getRemainingSeconds</a> ()</td>
+<td><div>long? <a href="#AlarmRelative::getRemainingSeconds">getRemainingSeconds</a> ()</div></td>
</tr>
<tr>
<td><a href="#AlarmAbsolute">AlarmAbsolute</a></td>
-<td>Date? <a href="#AlarmAbsolute::getNextScheduledDate">getNextScheduledDate</a> ()</td>
+<td><div>Date? <a href="#AlarmAbsolute::getNextScheduledDate">getNextScheduledDate</a> ()</div></td>
</tr>
</tbody>
</table>
<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="notification.html#UserNotification">UserNotification</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>
<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 =
+var notificationGroupDict =
{
- content: "This is a simple notification.",
- iconPath: "images/image1.jpg",
- soundPath: "music/Over the horizon.mp3"
+ content: "This is a simple user notification.",
+ actions:
+ {
+ soundPath: "music/Over the horizon.mp3",
+ vibration: true
+ }
};
-var notification = new tizen.StatusNotification("SIMPLE", "Simple notification", notificationDict);
+
+var notification = new tizen.UserNotification("SIMPLE", "User notification", notificationGroupDict);
tizen.alarm.addAlarmNotification(alarm, notification);
console.log("Alarm notification added with id: " + alarm.id);
</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>.
+ Gets the notification to be posted when an alarm is triggered. Returned <em>UserNotification</em> contains exactly the same data 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);
+<div class="synopsis"><pre class="signature prettyprint"><a href="notification.html#UserNotification">UserNotification</a> getAlarmNotification(<a href="#AlarmId">AlarmId</a> id);
</pre></div>
<p><span class="version">
Since: </span>
Privilege: </span>
http://tizen.org/privilege/alarm
</p>
+<p><span class="remark"> Remark : </span>
+ This method is designed to return only <a href="notification.html#UserNotification">UserNotification</a> objects,
+even if the added alarm was using <a href="notification.html#StatusNotification">StatusNofitication</a>.
+ </p>
<div class="parameters">
<p><span class="param">Parameters:</span></p>
<ul>
date.setHours(date.getHours() + 1);
var alarm = new tizen.AlarmAbsolute(date);
-var notificationDict =
+var notificationGroupDict =
{
- content: "This is a simple notification.",
- iconPath: "images/image1.jpg",
- soundPath: "music/Over the horizon.mp3"
+ content: "This is a simple user notification.",
+ actions:
+ {
+ soundPath: "music/Over the horizon.mp3",
+ vibration: true
+ }
};
-var notification = new tizen.StatusNotification("SIMPLE", "Simple notification", notificationDict);
+
+var notification = new tizen.UserNotification("SIMPLE", "User notification", notificationGroupDict);
/* 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);
+console.log("User 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.
+<span class="title"><p>Output example:</p></span><pre> User Notification title: User notification, content: This is a simple user notification.
</pre>
</div>
</dd>
interface AlarmAbsolute : <a href="#Alarm">Alarm</a> {
readonly attribute Date date;
- readonly attribute long? period;
-
readonly attribute <a href="#ByDayValue">ByDayValue</a>[] daysOfTheWeek;
Date? getNextScheduledDate() raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
interface AlarmAbsolute : <a href="#Alarm">Alarm</a> {
readonly attribute Date date;
- readonly attribute long? period;
-
readonly attribute <a href="#ByDayValue">ByDayValue</a>[] daysOfTheWeek;
Date? getNextScheduledDate() raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);