</ol></li>
</ol>
- <h2 id="templates" name="templates">Managing Notification templates</h2>
+ <h2 id="templates" name="templates">Managing Notification Templates</h2>
- <p>Learning how to manage notification templates allows you to save a notification as a template and use it later to faster creation of new notifications based on the same pattern:</p>
+ <p>Learning how to manage notification templates allows you to create a template from an existing notification, and reuse that template later to quickly create other notifications with the same pattern:</p>
+ <ul>
+ <li>To create a template:
<ol>
- <li><p>To save a template:</p>
- <ol type="a">
- <li>Create a <a href="#create">"SIMPLE"</a> or <a href="#progress">"PROGRESS"</a> notification, which would be used as a template. There is no need to post it.
+ <li>Create a <a href="#create">simple</a> or <a href="#progress">progress</a> notification to be used as a template.
+ <p>You do not need to post the notification to save it as a template.</p>
<pre class="prettyprint">
- // assume that myNotification is a valid tizen.StatusNotification object
+ /* Assume that myNotification is a valid tizen.StatusNotification object */
var myNotification;
</pre></li>
- <li><p>To save the template, use <code>saveNotificationAsTemplate()</code> method of the <code>NotificationManager</code> interface (in <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/notification.html#NotificationManager::saveNotificationAsTemplate">mobile</a> and <a href="../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/notification.html#NotificationManager::saveNotificationAsTemplate">wearable</a> applications):</p>
+ <li>Save the template with the <code>saveNotificationAsTemplate()</code> method of the <code>NotificationManager</code> interface (in <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/notification.html#NotificationManager">mobile</a> and <a href="../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/notification.html#NotificationManager">wearable</a> applications):
<pre class="prettyprint">
try {
- var templateName = "importantNoti";
- tizen.notification.saveNotificationAsTemplate(templateName, myNotification);
+ var templateName = "importantNoti";
+ tizen.notification.saveNotificationAsTemplate(templateName, myNotification);
} catch(e) {
- console.log("Error " + e.message + " occured");
+ console.log("Error " + e.message + " occured");
}
- </pre></li>
- </ol></li>
- <li><p>To use the template for creation of new pre-set notification, use the <code>createNotificationFromTemplate()</code> method of the <code>NotificationManager</code> interface (in <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/notification.html#NotificationManager::createNotificationFromTemplate">mobile</a> and <a href="../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/notification.html#NotificationManager::createNotificationFromTemplate">wearable</a> applications):</p>
+ </pre></li></ol>
+ </li>
+ <li>To use the template when creating a new notification, use the <code>createNotificationFromTemplate()</code> method of the <code>NotificationManager</code> interface:
<pre class="prettyprint">
try {
- var newTemplateNotification = tizen.notification.createNotificationFromTemplate(templateName);
- console.log("Content of new notification: " + content);
+ var newTemplateNotification = tizen.notification.createNotificationFromTemplate(templateName);
+ console.log("Content of new notification: " + content);
} catch (e) {
- console.log("Error " + e.message + " occured");
+ console.log("Error " + e.message + " occured");
}
- </pre></li>
- </ol></li>
- </ol>
+ </pre></li></ul>
<script type="text/javascript" src="../../scripts/jquery.zclip.min.js"></script>
<script type="text/javascript" src="../../scripts/showhide.js"></script>