From: Piotr Kosko
Related Info
You can create a progress notification that informs the user about the progress of an activity.
You can save templates and create notification based on existing template.
To display a notification, you need to create a Notification
object (in mobile and wearable applications), or its subtype.
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:
+To save a template:
++// assume that myNotification is a valid tizen.StatusNotification object +var myNotification; +
To save the template, use saveNotificationAsTemplate()
method of the NotificationManager
interface (in mobile and wearable applications):
+try { + var templateName = "importantNoti"; + tizen.notification.saveNotificationAsTemplate(templateName, myNotification); +} catch(e) { + console.log("Error " + e.message + " occured"); +} +
To use the template for creation of new pre-set notification, use the createNotificationFromTemplate()
method of the NotificationManager
interface (in mobile and wearable applications):
+try { + var newTemplateNotification = tizen.notification.createNotificationFromTemplate(templateName); + console.log("Content of new notification: " + content); +} catch (e) { + console.log("Error " + e.message + " occured"); +} +