From: Lukasz Bardeli Date: Thu, 17 Aug 2017 09:22:46 +0000 (+0200) Subject: [Documentation][Notification] Add guide and html X-Git-Tag: GitHub/PR#40/tizen-studio~68^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=54b951a86e56955e4ba50cccc588d23338a2f480;p=sdk%2Fonline-doc.git [Documentation][Notification] Add guide and html PS2: Guide content reviewed. Change-Id: Iffc42f77234f817f1f4cedda51e9266f87bfa689 Signed-off-by: Lukasz Bardeli --- diff --git a/org.tizen.guides/html/web/notification/notification_w.htm b/org.tizen.guides/html/web/notification/notification_w.htm index d60d809..cf01e18 100644 --- a/org.tizen.guides/html/web/notification/notification_w.htm +++ b/org.tizen.guides/html/web/notification/notification_w.htm @@ -62,11 +62,11 @@

You can create a template that can be reused in multiple notifications.

-

To display a notification, you need to create a Notification object (in mobile and wearable applications), or its subtype.

+

To display a notification, you need to create a Notification object (in mobile and wearable applications), or its subtype.

Note - Currently, only the StatusNotification subtype (in mobile and wearable applications) is supported. This subtype displays notifications in the status bar. + The StatusNotification subtype (in mobile and wearable applications) is deprecated since Tizen 4.0. To display notifications in the status bar, use the UserNotification subtype (in mobile and wearable applications).

Prerequisites

@@ -78,31 +78,35 @@

Creating Simple Notifications

-

Learning how to create status notifications allows you to design interactive applications that provide the user information about their events:

+

Learning how to create notifications allows you to design interactive applications that provide the user information about their events:

    -
  1. Define the status notification properties of the StatusNotificationInit interface (in mobile and wearable applications):

    +
  2. Define the notification properties of the UserNotificationInit interface (in mobile and wearable applications):

     /* Application control */
     var appControl = new tizen.ApplicationControl('http://tizen.org/appcontrol/operation/create_content',
                                                   null, 'image/jpg', null, null);
     
    -var notificationDict = {
    +var notificationGroupDict = {
         /* Notification content */
         content: 'This is a simple notification.',
    -    /* Path to the notification icon */
    -    iconPath: 'images/image1.jpg',
    -    /* Path to the sound file to be played when the notification is displayed */
    -    soundPath: 'music/Over the horizon.mp3',
    -    /* Device vibrates when the notification is displayed */
    -    vibration: true,
    -    /* Application control to be launched when the user selects the notification */
    -    appControl: appControl
    +    images: {
    +        /* Path to the notification icon */
    +        iconPath: 'images/image1.jpg'
    +    },
    +    actions: {
    +        /* Path to the sound file to be played when the notification is displayed */
    +        soundPath: 'music/Over the horizon.mp3',
    +        /* Device vibrates when the notification is displayed */
    +        vibration: true,
    +        /* Application control to be launched when the user selects the notification */
    +        appControl: appControl
    +    }
     };
     

    The path in the iconPath and soundPath parameters means a relative file location defined in the Filesystem API (in mobile and wearable applications). The path is not an absolute file location, but instead uses a virtual root location (such as images in images/image1.jpg).

  3. -
  4. To be able to display the notification, create a StatusNotification object (in mobile and wearable applications) with the status notification type, title, and the additional notification properties defined in the previous step.

    +
  5. To be able to display the notification, create a UserNotification object (in mobile and wearable applications) with the notification type, title, and the additional notification properties defined in the previous step.

    -var notification = new tizen.StatusNotification('SIMPLE', 'Simple notification', notificationDict);
    +var notification = new tizen.UserNotification('SIMPLE', 'Simple notification', notificationGroupDict);
     
  6. To post the notification, use the post() method of the NotificationManager interface (in mobile and wearable applications):

    @@ -114,31 +118,37 @@ tizen.notification.post(notification);
     
       

    Learning how to create progress notifications allows you to design interactive applications that inform the user about the progress of an activity:

      -
    1. Define the status notification properties of the StatusNotificationInit dictionary (in mobile and wearable applications):

      +
    2. Define the notification properties of the UserNotificationInit interface (in mobile and wearable applications):

       /* Application control */
       var appControl = new tizen.ApplicationControl('http://tizen.org/appcontrol/operation/create_content',
                                                     null, 'image/jpg', null, null);
       
      -var notificationDict = {
      +var notificationGroupDict = {
           content: 'This is a progress notification.',
      -    iconPath: 'images/image1.jpg',
      -    vibration: false,
      -    appControl: appControl,
      -    progressType: 'PERCENTAGE',
      -    progressValue: 0
      +    images: {
      +        iconPath: 'images/image1.jpg'
      +    },
      +    actions: {
      +        vibration: false,
      +        appControl: appControl
      +    },
      +    textContents: {
      +        progressType: 'PERCENTAGE',
      +        progressValue: 0
      +    },
       };
       
      -

      The path in the iconPath and soundPath parameters means a file location defined in the Filesystem API (in mobile and wearable applications). The path is not an absolute file location, but instead uses a virtual root location (such as images in images/image1.jpg).

    3. -
    4. To be able to display the notification, create a StatusNotification object (in mobile and wearable applications) with the status notification type, title, and the additional notification properties defined in the previous step:

      +

      The path in the iconPath parameter means a file location defined in the Filesystem API (in mobile and wearable applications). The path is not an absolute file location, but instead uses a virtual root location (such as images in images/image1.jpg).

    5. +
    6. To be able to display the notification, create a UserNotification object (in mobile and wearable applications) with the notification type, title, and the additional notification properties defined in the previous step:

      -var notification = new tizen.StatusNotification('PROGRESS', 'Progress notification', notificationDict);
      +var notification = new tizen.UserNotification('PROGRESS', 'Progress notification', notificationGroupDict);
       
    7. Define a function which uses the update() method of the NotificationManager interface (in mobile and wearable applications) to update the posted notification every second:

       function updateProgressNotification(progress) {
           if (progress <= 100) {
      -        notification.progressValue = progress;
      +        notification.textContents.progressValue = progress;
               tizen.notification.update(notification);
               setTimeout(function() {
                   updateProgressNotification(progress + 10);
      @@ -159,15 +169,15 @@ updateProgressNotification(0);
       			

      Learning how to manage notifications allows you to design interactive applications that provide the user information about their events:

      1. To retrieve notifications:

        -
          -
        1. To retrieve a previously posted notification, use the get() method of the NotificationManager interface (in mobile and wearable applications with the notification ID as a parameter: +
            +
          • To retrieve a previously posted notification, use the getNotification() method of the NotificationManager interface (in mobile and wearable applications with the notification ID as a parameter:
             var myId = notification.id;
            -var myNotification = tizen.notification.get(myId);
            +var myNotification = tizen.notification.getNotification(myId);
             
          • -
          • To retrieve all previously posted notifications, use the getAll() method, which returns all the notifications as an array:

            +
          • To retrieve all previously posted notifications, use the getAllNotifications() method, which returns all the notifications as an array:

            -var notifications = tizen.notification.getAll();
            +var notifications = tizen.notification.getAllNotifications();
             var index = 0;
             
             /* For each notification, write the ID and title in the console log */
            @@ -176,14 +186,14 @@ for (index = 0; index < notifications.length; index++) {
                 console.log(notifications[index].title);
             }
             
          • -
      2. +
      3. To update a previously posted notification, use the update() method by specifying the updated notification object:

         myNotification.content = 'My notification';
         tizen.notification.update(myNotification);
         
      4. To remove notifications: -
          +
          • To remove a previously posted notification, use the remove() method with the notification ID as a parameter:

             tizen.notification.remove(myNotification.id);
            @@ -192,7 +202,7 @@ tizen.notification.remove(myNotification.id);
             
             tizen.notification.removeAll();
             
          • -
      5. +

      Managing Notification Templates

      @@ -204,7 +214,7 @@ tizen.notification.removeAll();
    8. Create a simple or progress notification to be used as a template.

      You do not need to post the notification to save it as a template.

      -/* Assume that myNotification is a valid tizen.StatusNotification object */
      +/* Assume that myNotification is a valid tizen.UserNotification object */
       var myNotification;
       
    9. Save the template with the saveNotificationAsTemplate() method of the NotificationManager interface (in mobile and wearable applications): @@ -221,12 +231,12 @@ try {
       try {
           var newTemplateNotification = tizen.notification.createNotificationFromTemplate(templateName);
      -    console.log('Content of new notification: '  + content);
      +    console.log('Content of new notification: '  + newTemplateNotification.content);
       } catch (e) {
           console.log('Error ' + e.message + ' occurred');
       }
      -
    10. - +
      +

      This method returns a UserNotification object (in mobile and wearable applications), even if the template was created based on a StatusNotification object (in mobile and wearable applications).

    11. diff --git a/org.tizen.web.apireference/html/device_api/mobile/tizen/notification.html b/org.tizen.web.apireference/html/device_api/mobile/tizen/notification.html index 6269f20..0bdaca4 100755 --- a/org.tizen.web.apireference/html/device_api/mobile/tizen/notification.html +++ b/org.tizen.web.apireference/html/device_api/mobile/tizen/notification.html @@ -30,14 +30,17 @@ For more information on the Notification features, see NotificationType -
    12. +
    13. 1.3. StatusNotificationType
    14. - 1.4. NotificationProgressType + 1.4. UserNotificationType +
    15. +
    16. + 1.5. NotificationProgressType
    17. - 1.5. LEDCustomFlags + 1.6. LEDCustomFlags
    18. @@ -48,11 +51,27 @@ For more information on the Notification features, see Notification -
    19. 2.4. StatusNotificationInit +
    20. 2.4. StatusNotificationInit +
    21. +
    22. 2.5. UserNotificationInit +
    23. +
    24. 2.6. NotificationTextContentInfo +
    25. +
    26. 2.7. NotificationImageInfo +
    27. +
    28. 2.8. NotificationThumbnailInfo +
    29. +
    30. 2.9. NotificationActionInfo
    31. -
    32. 2.5. StatusNotification +
    33. 2.10. NotificationGroupContentInfo
    34. -
    35. 2.6. NotificationDetailInfo +
    36. 2.11. NotificationLedInfo +
    37. +
    38. 2.12. StatusNotification +
    39. +
    40. 2.13. UserNotification +
    41. +
    42. 2.14. NotificationDetailInfo
    43. @@ -81,14 +100,14 @@ For more information on the Notification features, see remove (NotificationId id)
      void removeAll ()
      +Notification getNotification (NotificationId id) +Notification[] getAllNotifications ()
      void playLEDCustomEffect (long timeOn, long timeOff, DOMString color, LEDCustomFlags[] flags)
      void saveNotificationAsTemplate (DOMString name, Notification notification)
      +UserNotification createNotificationFromTemplate (DOMString name) @@ -96,11 +115,35 @@ For more information on the Notification features, see StatusNotificationInit +UserNotificationInit + + + +NotificationTextContentInfo + + + +NotificationImageInfo + + + +NotificationThumbnailInfo + + + +NotificationActionInfo + + + +NotificationGroupContentInfo + + + +NotificationLedInfo -StatusNotification +UserNotification @@ -143,11 +186,14 @@ The status notification consists of an icon, title, content, and time. The statu -
      +

      1.3. StatusNotificationType

      A status notification type.
      +

      Deprecated. + Deprecated since 4.0. Use UserNotificationType instead. +

          enum StatusNotificationType { "SIMPLE", "THUMBNAIL", "ONGOING", "PROGRESS" };

      Since: @@ -171,8 +217,36 @@ PROGRESS - A status notification that displays information on the progress of a

      +
      +

      1.4. UserNotificationType

      +
      + A user notification type. +
      +
          enum UserNotificationType { "SIMPLE", "THUMBNAIL", "ONGOING", "PROGRESS" };
      +

      + Since: + 4.0 +

      +
      +

      +The following user notification types are supported: +

      +
        +
      • +SIMPLE - A basic user notification type that is removed automatically when selected by the user. All simple user notifications can be removed by user interaction.
      • +
      • +THUMBNAIL - The thumbnail user notification posts a thumbnail-format notification which includes several thumbnail image paths. +The thumbnail user notification is also removed by user selection. +
      • +
      • +ONGOING - An user notification type that informs the user whether an application is running or not.
      • +
      • +PROGRESS - An user notification that displays information on the progress of a job. However, this user notification should be removed by the application that posted the notification.
      • +
      +
      +
      -

      1.4. NotificationProgressType

      +

      1.5. NotificationProgressType

      A notification progress type.
      @@ -194,7 +268,7 @@ The following notification progress types are supported:
      -

      1.5. LEDCustomFlags

      +

      1.6. LEDCustomFlags

      Specifies custom LED flags. The following values are supported in this release : @@ -251,17 +325,17 @@ Notification API. void removeAll() raises(WebAPIException); - Notification get(NotificationId id) raises(WebAPIException); + Notification getNotification(NotificationId id) raises(WebAPIException); - Notification[] getAll() raises(WebAPIException); + Notification[] getAllNotifications() raises(WebAPIException); - void playLEDCustomEffect(long timeOn, long timeOff, DOMString color, LEDCustomFlags[] flags) raises(WebAPIException); + void playLEDCustomEffect(long timeOn, long timeOff, DOMString color, LEDCustomFlags[] flags) raises(WebAPIException); - void stopLEDCustomEffect() raises(WebAPIException); + void stopLEDCustomEffect() raises(WebAPIException); - void saveNotificationAsTemplate(DOMString name, Notification notification) raises(WebAPIException); + void saveNotificationAsTemplate(DOMString name, Notification notification) raises(WebAPIException); - Notification createNotificationFromTemplate(DOMString name) raises(WebAPIException); + UserNotification createNotificationFromTemplate(DOMString name) raises(WebAPIException); };

    Since: @@ -325,29 +399,102 @@ parameters contain an invalid value.

  7. -

    Code example:

    -try
    -{
    -   var appControl = new tizen.ApplicationControl("http://tizen.org/appcontrol/operation/create_content",
    +

    Code example:

     try
    + {
    +   var appControl = new tizen.ApplicationControl("http://tizen.org/appcontrol/operation/view",
                                                      null, "image/jpg", null);
    -   var notificationDict =
    +
    +   var notificationGroupDict =
        {
    -      content: "This is a simple notification.",
    -      iconPath: "images/image1.jpg",
    -      soundPath: "music/Over the horizon.mp3",
    -      vibration: true,
    -      appControl: appControl
    +     content: "This is a simple user notification.",
    +     actions:
    +     {
    +       soundPath: "music/Over the horizon.mp3",
    +       vibration: true,
    +       appControl: appControl
    +     }
        };
     
    -   var notification = new tizen.StatusNotification("SIMPLE", "Simple notification", notificationDict);
    +   /* Constructs and posts the simple user notification */
    +   var notification = new tizen.UserNotification("SIMPLE", "User notification", notificationGroupDict);
    +   tizen.notification.post(notification);
    + }
    + catch (err)
    + {
    +   console.log(err.name + ": " + err.message);
    + }
    + 
    +
    +
    +

    Code example:

     try
    + {
    +   var notificationGroupDict =
    +   {
    +     content: "This is a thumbnail user notification.",
    +     thumbnails:
    +     {
    +       thumbnailIconPath: "images/thumbnail.jpg"
    +     }
    +   };
     
    +   /* Constructs and posts the thumbnail user notification */
    +   var notification = new tizen.UserNotification("THUMBNAIL", "User notification", notificationGroupDict);
        tizen.notification.post(notification);
    -}
    -catch (err)
    -{
    + }
    + catch (err)
    + {
        console.log(err.name + ": " + err.message);
    -}
    -
    + } + +
    +
    +

    Code example:

     try
    + {
    +   var notificationGroupDict =
    +   {
    +     content: "This is an ongoing user notification.",
    +     images:
    +     {
    +       iconPath: "images/simple_icon.jpg"
    +     }
    +   };
    +
    +   /* Constructs and posts the ongoing user notification. */
    +   var notification = new tizen.UserNotification("ONGOING", "User notification", notificationGroupDict);
    +   tizen.notification.post(notification);
    + }
    + catch (err)
    + {
    +   console.log(err.name + ": " + err.message);
    + }
    + 
    +
    +
    +

    Code example:

     try
    + {
    +   var notificationGroupDict =
    +   {
    +     content: "This is a progress user notification.",
    +     textContents:
    +     {
    +       progressValue: 20
    +     },
    +     actions:
    +     {
    +       soundPath: "music/Over the horizon.mp3",
    +       vibration: false
    +     }
    +   };
    +
    +   /* Constructs and posts the progress user notification */
    +   var notification = new tizen.UserNotification("PROGRESS", "User notification", notificationGroupDict);
    +   tizen.notification.post(notification);
    + }
    + catch (err)
    + {
    +   console.log(err.name + ": " + err.message);
    + }
    + 
    @@ -400,18 +547,17 @@ parameters contain an invalid value.
    -

    Code example:

    -try
    -{
    +

    Code example:

     try
    + {
        /* Uses a variable for the previously posted notification */
        notification.content = "My notification";
        tizen.notification.update(notification);
    -}
    -catch (err)
    -{
    + }
    + catch (err)
    + {
        console.log(err.name + ": " + err.message);
    -}
    -
    + } +
    @@ -463,17 +609,16 @@ catch (err)
    -

    Code example:

    -try
    -{
    +

    Code example:

     try
    + {
        /* Uses a variable for the previously posted notification */
        tizen.notification.remove(notification.id);
    -}
    -catch (err)
    -{
    + }
    + catch (err)
    + {
        console.log(err.name + ": " + err.message);
    -}
    -
    + } +
    @@ -510,30 +655,35 @@ catch (err)
    -

    Code example:

    -try
    -{
    +

    Code example:

     try
    + {
        tizen.notification.removeAll();
    -}
    -catch (err)
    -{
    + }
    + catch (err)
    + {
        console.log(err.name + ": " + err.message);
    -}
    -
    + } +
    -
    +
    get
    -
    +
    Gets a notification that has previously been posted by the current application. Note that the obtained notification's progressType is PERCENTAGE
    +

    Deprecated. + Deprecated since 4.0. Use getNotification instead. +

    Since: 2.0

    +

    Remark : + This method is designed to return old-style notification. +

    Parameters:

      @@ -556,34 +706,92 @@ catch (err)
    -

    Code example:

    -try
    -{
    +

    Code example:

     try
    + {
        /* Uses a variable for the previously posted notification */
        /* Saves the notification ID for future use */
        var myId = notification.id;
     
        var myNotification = tizen.notification.get(myId);
    -}
    -catch (err)
    -{
    + }
    + catch (err)
    + {
        console.log(err.name + ": " + err.message);
    -}
    -
    + } +
    -
    -getAll +
    +getNotification
    + Gets a notification that has previously been posted by the current application. Note that the obtained notification's progressType is PERCENTAGE. +
    +
    Notification getNotification(NotificationId id);
    +             
    +

    + Since: + 4.0 +

    +

    Remark : + This method is designed to return new representation of a notification. +

    +
    +

    Parameters:

    +
      +
    • +id: + A previously posted notification ID. +
    • +
    +
    +
    +

    Exceptions:

    +
    • WebAPIException
        +
      • + with error type NotFoundError, if NotificationId is not found in the previously posted notifications. +

      • +
      • + with error type AbortError, if any other error occurs. +

      • +
      +
    +
    +
    +

    Code example:

     try
    + {
    +   /* Uses a variable for the previously posted notification */
    +   /* Saves the notification ID for future use */
    +   var myId = notification.id;
    +
    +   var myNotification = tizen.notification.getNotification(myId);
    + }
    + catch (err)
    + {
    +   console.log(err.name + ": " + err.message);
    + }
    + 
    +
    +
    +
    +getAll +
    +
    +
    Gets all notifications that have previously been posted by the current application. Note that the obtained notification's progressType is PERCENTAGE
    +

    Deprecated. + Deprecated since 4.0. Use getAllNotifications instead. +

    Notification[] getAll();
                  

    Since: 2.0

    +

    Remark : + This method is designed to return old-style notifications. +

    Exceptions:

    • WebAPIException
      • @@ -592,31 +800,77 @@ catch (err)

    -

    Code example:

    -try
    -{
    +

    Code example:

     try
    + {
        var notifications = tizen.notification.getAll();
    -   var index = 0;
     
    -   for (index = 0; index < notifications.length; index++)
    +   for (var index = 0; index < notifications.length; index++)
        {
    -      console.log(notifications[index].id);
    -      console.log(notifications[index].title);
    -      console.log(notifications[index].statusType);
    -      console.log(notifications[index].type);
    -      console.log(notifications[index].content);
    -      console.log(notifications[index].postedTime);
    -      console.log(notifications[index].iconPath);
    -      console.log(notifications[index].soundPath);
    -      console.log(notifications[index].vibration);
    -      console.log(notifications[index].appControl);
    +     console.log(notifications[index].id);
    +     console.log(notifications[index].title);
    +     console.log(notifications[index].statusType);
    +     console.log(notifications[index].type);
    +     console.log(notifications[index].content);
    +     console.log(notifications[index].postedTime);
    +     console.log(notifications[index].iconPath);
    +     console.log(notifications[index].soundPath);
    +     console.log(notifications[index].vibration);
    +     console.log(notifications[index].appControl);
        }
    -}
    -catch (err)
    -{
    + }
    + catch (err)
    + {
        console.log(err.name + ": " + err.message);
    -}
    -
    + } +
    +
    +
    +
    +getAllNotifications +
    +
    +
    + Gets all notifications that have previously been posted by the current application. Note that the obtained notification's progressType is PERCENTAGE. +
    +
    Notification[] getAllNotifications();
    +             
    +

    + Since: + 4.0 +

    +

    Remark : + This method is designed to return new representation of a notifications. +

    +
    +

    Exceptions:

    +
    • WebAPIException
      • + with error type AbortError, if any error occurs. +

      +
    +
    +
    +

    Code example:

     try
    + {
    +   var notifications = tizen.notification.getAllNotifications();
    +
    +   for (var index = 0; index < notifications.length; index++)
    +   {
    +     console.log(notifications[index].id);
    +     console.log(notifications[index].type);
    +     console.log(notifications[index].userType);
    +     console.log(notifications[index].content);
    +     console.log(notifications[index].postedTime);
    +     console.log(notifications[index].images.iconPath);
    +     console.log(notifications[index].actions.soundPath);
    +     console.log(notifications[index].actions.vibration);
    +     console.log(notifications[index].actions.appControl);
    +   }
    + }
    + catch (err)
    + {
    +   console.log(err.name + ": " + err.message);
    + }
    + 
    @@ -687,16 +941,15 @@ is not given (in this case alpha is assumed to have value 0xff). In this case on
    -

    Code example:

    -try
    -{
    +

    Code example:

     try
    + {
        tizen.notification.playLEDCustomEffect(1000, 1000, "#FFFF0080", ["LED_CUSTOM_DUTY_ON", "LED_CUSTOM_DEFAULT"]);
    -}
    -catch (e)
    -{
    -   console.log("Error Exception, error name: " + e.name + ", error message: " + e.message);
    -}
    -
    + } + catch (err) + { + console.log("Error Exception, error name : " + err.name + ", error message : " + err.message); + } +
    @@ -733,19 +986,19 @@ catch (e)
    -

    Code example:

    -try
    -{
    +

    Code example:

     try
    + {
        tizen.notification.playLEDCustomEffect(1000, 1000, "#FFFF0080", ["LED_CUSTOM_DUTY_ON", "LED_CUSTOM_DEFAULT"]);
        setTimeout(function()
        {
    -      tizen.notification.stopLEDCustomEffect();
    +     tizen.notification.stopLEDCustomEffect();
        }, 5000);
    -}
    -catch (e)
    -{
    -   console.log("Error Exception, error name: " + e.name + ", error message: " + e.message);
    -
    + } + catch (err) + { + console.log("Error Exception, error name : " + err.name + ", error message : " + err.message); + } +
    @@ -814,23 +1067,32 @@ All templates are removed when the application package is uninstalled.
    -

    Code example:

    -try {
    -    var notificationDict = {
    -                content : "This is a simple notification.",
    -                iconPath : "images/image1.jpg",
    -                soundPath : "music/Over the horizon.mp3",
    -                vibration : true
    -    };
    +

    Code example:

     try
    + {
    +   var notificationGroupDict =
    +   {
    +     content: "This is a progress notification.",
    +     images:
    +     {
    +       iconPath: "images/image2.jpg"
    +     },
    +     actions:
    +     {
    +       soundPath: "music/Over the horizon.mp3",
    +       vibration: true
    +     }
    +   };
     
    -    var notification = new tizen.StatusNotification("SIMPLE",
    -                "Simple notification", notificationDict);
    +   /* Constructs the progress notification */
    +   var notification = new tizen.UserNotification("PROGRESS", "Progress notification", notificationGroupDict);
     
    -    tizen.notification.saveNotificationAsTemplate("SIMPLE_TEMPLATE", notification);
    -} catch (err) {
    -    console.log(err.name + ": " + err.message);
    -}
    -
    + tizen.notification.saveNotificationAsTemplate("PROGRESS_TEMPLATE", notification); + } + catch (err) + { + console.log(err.name + ": " + err.message); + } +
    @@ -840,7 +1102,7 @@ try {
    Creates notification based on previously created template.
    -
    Notification createNotificationFromTemplate(DOMString name);
    +
    UserNotification createNotificationFromTemplate(DOMString name);
                  

    Since: @@ -860,6 +1122,9 @@ An application can load only templates that it has saved. Privilege: http://tizen.org/privilege/notification

    +

    Remark : + This method is designed to return only UserNotification objects, even if the template was saved as StatusNotification. +

    Parameters:

      @@ -885,14 +1150,17 @@ An application can load only templates that it has saved.
    -

    Code example:

    -/* the template with name "SIMPLE_TEMPLATE" should be previously created */
    -try {
    -    var notification = tizen.notification.createNotificationFromTemplate("SIMPLE_TEMPLATE");
    -} catch (err) {
    -     console.log(err.name + ": " + err.message);
    -}
    -
    +

    Code example:

     /* the template with name "SIMPLE_TEMPLATE" should be previously created */
    + try
    + {
    +   var notification = tizen.notification.createNotificationFromTemplate("SIMPLE_TEMPLATE");
    +   console.log("UserNotification - " + notification.title);
    + }
    + catch (err)
    + {
    +   console.log(err.name + ": " + err.message);
    + }
    + 
    @@ -905,7 +1173,6 @@ try {
        [NoInterfaceObject] interface Notification {
     
    -
         readonly attribute NotificationId id;
     
         readonly attribute NotificationType type;
    @@ -975,11 +1242,14 @@ try {
     
     
     
    -
    +

    2.4. StatusNotificationInit

    - The properties of StatusNotification, to pass a constructor. + The properties of StatusNotification, to pass to the constructor.
    +

    Deprecated. + Deprecated since 4.0. Use UserNotificationInit instead. +

        dictionary StatusNotificationInit {
             DOMString? content;
             DOMString? iconPath;
    @@ -1003,94 +1273,601 @@ try {
      2.0
               

    -
    -

    2.5. StatusNotification

    +
    +

    2.5. UserNotificationInit

    - The StatusNotification interface represents a status notification and offers additional attributes to represent a notification displayed in the notification tray. + The properties of UserNotification, to pass to the constructor, grouped by its functions.
    -
       [Constructor(StatusNotificationType statusType, DOMString title, optional StatusNotificationInit? notificationInitDict)]
    -
    -
    -    interface StatusNotification : Notification {
    -
    -    readonly attribute StatusNotificationType statusType;
    -
    -    attribute DOMString? iconPath;
    -
    -    attribute DOMString? subIconPath;
    -
    -    attribute long? number;
    -
    -    attribute NotificationDetailInfo[]? detailInfo;
    -
    -    attribute DOMString? ledColor;
    -
    -    attribute unsigned long ledOnPeriod;
    -
    -    attribute unsigned long ledOffPeriod;
    -
    -     attribute DOMString? backgroundImagePath;
    -
    -     attribute DOMString[]? thumbnails;
    -
    -     attribute DOMString? soundPath;
    -
    -     attribute boolean vibration;
    -
    -     attribute ApplicationControl? appControl;
    -
    -     attribute ApplicationId? appId;
    -
    -     attribute NotificationProgressType progressType;
    -
    -     attribute unsigned long? progressValue;
    +
        dictionary UserNotificationInit {
    +        DOMString? content;
    +        NotificationTextContentInfo? textContents;
    +        NotificationImageInfo? images;
    +        NotificationThumbnailInfo? thumbnails;
    +        NotificationActionInfo? actions;
    +        NotificationGroupContentInfo? groupContents;
    +        NotificationLedInfo? leds;
         };

    Since: - 2.0 + 4.0

    -All notifications must have a title attribute. +For detailed descriptions of properties, please refer to Notification and UserNotification.

    - -
    -

    Constructors

    -
    StatusNotification(StatusNotificationType statusType, DOMString title, optional StatusNotificationInit? notificationInitDict);
    +

    Remark : + Some of the specified options might be ignored if the device does not support related feature (e.g. LED notification settings). +

    -
    -

    Attributes

    -
      -
    • - readonly -StatusNotificationType statusType
      - The status notification type. -
      +
      +

      2.6. NotificationTextContentInfo

      +
      + Additional properties of UserNotification. These properties are used for modifying values contained in a notification. +
      +
          dictionary NotificationTextContentInfo {
      +        NotificationProgressType? progressType;
      +        unsigned long? progressValue;
      +        long? eventsNumber;
      +        NotificationDetailInfo[]? detailInfo;
      +        DOMString[]? buttonsTexts;
      +        DOMString? contentForOff;
      +    };

      Since: - 2.0 -

      -
    • -
    • -DOMString iconPath [nullable]
      - The icon path to display in the notification. -
      + 4.0 +

      +

      Remark : + Some members of notification could have no effect depending on the device. +

      +
      +

      Dictionary members

      +
      +
      NotificationProgressType? progressType
      +
      +
      + Defines the type for a PROGRESS notification's progress. +By default, this attribute is set to PERCENTAGE. +

      Since: - 2.0 + 4.0

      -
    • -
    • -DOMString subIconPath [nullable]
      - The sub icon path to display in the notification. -
      + +
      unsigned long? progressValue
      +
      +
      + Defines the current notification progress value (PERCENTAGE or BYTE), depending on the progressType
      +
      +

      +If progressValue is set, the progressbar will be displayed in the notification. The progressValue can change the amount of progress as it moves forward or backward. It gets the progress value of the current notification. +If 0, the indeterminate progressbar will be shown. +This attribute only affects for UserNotification of type PROGRESS. +

      +

      +Applications should keep the progress value for its job because +the saved value in the notification status tray can be different from +the exact progress value. +

      +

      +Range of progressValue for PERCENTAGE progressType is from 0 to 100. +

      +

      Since: - 2.1 + 4.0

      -
    • -
    • +
      +

      Code example:

       try
      + {
      +   var appControl = new tizen.ApplicationControl("http://tizen.org/appcontrol/operation/create_content",
      +                                                 null, "image/jpg", null);
      +
      +   var notificationGroupDict =
      +   {
      +     content: "This is a progress notification.",
      +     textContents:
      +     {
      +       progressValue: 20
      +     },
      +     images:
      +     {
      +       iconPath: "images/image2.jpg"
      +     },
      +     actions:
      +     {
      +       soundPath: "music/Over the horizon.mp3",
      +       vibration: true,
      +       appControl: appControl
      +     }
      +   };
      +
      +   /* Constructs the progress notification */
      +   var notification = new tizen.UserNotification("PROGRESS", "Progress notification", notificationGroupDict);
      +   /* Posts the notification */
      +   tizen.notification.post(notification);
      +
      +   /* Updates the progress value of the notification */
      +   notification.textContents.progressValue = 59;
      +   tizen.notification.update(notification);
      + }
      + catch (err)
      + {
      +   console.log(err.name + ": " + err.message);
      + }
      + 
      +
      + +
      long? eventsNumber
      +
      +
      + The number of events to display in the notification. +
      +

      + Since: + 4.0 +

      +
      +
      NotificationDetailInfo[]? detailInfo
      +
      +
      + Appends lines of the detail information to the notification. +This attribute is available in a simple status notification. +
      +
      +

      +By default, this attribute is initialized with an empty array. +The maximum number of detail information elements in the array is 2. +

      +
      +

      + Since: + 4.0 +

      +
      +
      DOMString[]? buttonsTexts
      +
      +
      + The text for buttons. +
      +

      + Since: + 4.0 +

      +
      +
      DOMString? contentForOff
      +
      +
      + The content to show when the option to display content is off in the Settings. +
      +

      + Since: + 4.0 +

      +
      + +
    +
    +
    +

    2.7. NotificationImageInfo

    +
    + Additional properties of UserNotification. These properties are used for modifying the appearance of a notification. +
    +
        dictionary NotificationImageInfo {
    +        DOMString? iconPath;
    +        DOMString? subIconPath;
    +        DOMString? indicatorIconPath;
    +        DOMString? lockScreenIconPath;
    +        DOMString[]? buttonIconPaths;
    +        DOMString? backgroundImagePath;
    +    };
    +

    + Since: + 4.0 +

    +

    Remark : + Some members of notification could have no effect depending on the device. +

    +
    +

    Dictionary members

    +
    +
    DOMString? iconPath
    +
    +
    + The icon path to display in the notification. +
    +

    + Since: + 4.0 +

    +
    +
    DOMString? subIconPath
    +
    +
    + The sub icon path to display in the notification. +
    +

    + Since: + 4.0 +

    +
    +
    DOMString? indicatorIconPath
    +
    +
    + The path for the indicator icon. +
    +

    + Since: + 4.0 +

    +
    +
    DOMString? lockScreenIconPath
    +
    +
    + The path for the lock screen icon. +
    +

    + Since: + 4.0 +

    +
    +
    DOMString[]? buttonIconPaths
    +
    +
    + The paths for button icons. +
    +

    + Since: + 4.0 +

    +
    +
    DOMString? backgroundImagePath
    +
    +
    + The image path to use as the background of the notification. +This attribute is available on simple or thumbnail status notifications. +
    +

    + Since: + 4.0 +

    +
    +
    +
    +
    +
    +

    2.8. NotificationThumbnailInfo

    +
    + Additional properties of UserNotification. These properties are used for modifying the thumbnails of a notification. +
    +
        dictionary NotificationThumbnailInfo {
    +        DOMString? lockScreenThumbnailIconPath;
    +        DOMString? thumbnailIconPath;
    +        DOMString[]? thumbnails;
    +    };
    +

    + Since: + 4.0 +

    +

    Remark : + Some members of notification could have no effect depending on the device. +

    +
    +

    Dictionary members

    +
    +
    DOMString? lockScreenThumbnailIconPath
    +
    +
    + The path for the lock screen thumbnail icon. +
    +

    + Since: + 4.0 +

    +
    +
    DOMString? thumbnailIconPath
    +
    +
    + The path for the thumbnail icon. +
    +

    + Since: + 4.0 +

    +
    +
    DOMString[]? thumbnails
    +
    +
    + The image paths associated with the thumbnail status notification. +
    +
    +

    +By default, this attribute is initialized with an empty array. +The maximum number of thumbnail path elements in the array is 4. +

    +
    +

    + Since: + 4.0 +

    +
    +
    +
    +
    +
    +

    2.9. NotificationActionInfo

    +
    + Additional properties of UserNotification. These properties are used for modifying the actions related to the notification. +
    +
        dictionary NotificationActionInfo {
    +        DOMString? soundPath;
    +        boolean? vibration;
    +        ApplicationControl? appControl;
    +        ApplicationId? appId;
    +    };
    +

    + Since: + 4.0 +

    +

    Remark : + Some members of notification could have no effect depending on the device. +

    +
    +

    Dictionary members

    +
    +
    DOMString? soundPath
    +
    +
    + The path of a sound file to play when the notification is shown. +
    +

    + Since: + 4.0 +

    +
    +
    boolean? vibration
    +
    +
    + Checks whether to vibrate when the notification is shown. By default, this attribute is set to false. +
    +

    + Since: + 4.0 +

    +
    +
    ApplicationControl? appControl
    +
    +
    + Holds the application control to launch an application when the notification is selected from the notification tray. +
    +

    + Since: + 4.0 +

    +
    +
    ApplicationId? appId
    +
    +
    + Holds the application ID to launch when the notification is selected from the notification tray. +
    +

    + Since: + 4.0 +

    +
    +
    +
    +
    +
    +

    2.10. NotificationGroupContentInfo

    +
    + Additional properties of UserNotification. These properties are used for modifying the appearance of group content of a notification. +
    +
        dictionary NotificationGroupContentInfo {
    +        DOMString? groupTitle;
    +        DOMString? groupContent;
    +        DOMString? groupContentForOff;
    +    };
    +

    + Since: + 4.0 +

    +

    Remark : + Some members of notification could have no effect depending on the device. +

    +
    +

    Dictionary members

    +
    +
    DOMString? groupTitle
    +
    +
    + The group title. +
    +

    + Since: + 4.0 +

    +
    +
    DOMString? groupContent
    +
    +
    + The group content. +
    +

    + Since: + 4.0 +

    +
    +
    DOMString? groupContentForOff
    +
    +
    + The group content to show when the option to display content is off in the Settings. +
    +

    + Since: + 4.0 +

    +
    +
    +
    +
    +
    +

    2.11. NotificationLedInfo

    +
    + Additional properties of UserNotification. These properties are used for modifying the LED behaviour of a notification. +
    +
        dictionary NotificationLedInfo {
    +        DOMString? ledColor;
    +        unsigned long ledOnPeriod;
    +        unsigned long ledOffPeriod;
    +    };
    +

    + Since: + 4.0 +

    +

    Remark : + Some members of notification could have no effect depending on the device. +

    +
    +

    Dictionary members

    +
    +
    DOMString? ledColor
    +
    +
    + Sets the notification LED indicator color property. +The color is a numerical RGB value(#rrggbb). The format of an RGB value in hexadecimal notation is a "#" immediately followed +by exactly six hexadecimal characters(0-9, A-F). The color format is case-insensitive. +
    +
    +

    +The LED indicator color will show that it's a close approximation. +LED will only light on when the screen is off. To turn the LED off, set "#000000" or null to ledColor. +This method has effects when the device has notification LED. +

    +
    +

    + Since: + 4.0 +

    +
    +
    unsigned long ledOnPeriod
    +
    +
    + The milliseconds for which the light is on. +The light continuously toggles on (ledOnPeriod) and off (ledOffPeriod). +By default, this attribute is set to 0 +
    +

    + Since: + 4.0 +

    +
    +
    unsigned long ledOffPeriod
    +
    +
    + The milliseconds for which the light is off. +By default, this attribute is set to 0. +
    +

    + Since: + 4.0 +

    +
    +
    +
    +
    +
    +

    2.12. StatusNotification

    +
    + The StatusNotification interface represents a status notification and offers additional attributes to represent a notification displayed in the notification tray. +
    +

    Deprecated. + Deprecated since 4.0. Use UserNotification instead. +

    +
        [Constructor(StatusNotificationType statusType, DOMString title, optional StatusNotificationInit? notificationInitDict)]
    +
    +    interface StatusNotification : Notification {
    +
    +    readonly attribute StatusNotificationType statusType;
    +
    +    attribute DOMString? iconPath;
    +
    +    attribute DOMString? subIconPath;
    +
    +    attribute long? number;
    +
    +    attribute NotificationDetailInfo[]? detailInfo;
    +
    +    attribute DOMString? ledColor;
    +
    +    attribute unsigned long ledOnPeriod;
    +
    +    attribute unsigned long ledOffPeriod;
    +
    +    attribute DOMString? backgroundImagePath;
    +
    +    attribute DOMString[]? thumbnails;
    +
    +    attribute DOMString? soundPath;
    +
    +    attribute boolean vibration;
    +
    +    attribute ApplicationControl? appControl;
    +
    +    attribute ApplicationId? appId;
    +
    +    attribute NotificationProgressType progressType;
    +
    +    attribute unsigned long? progressValue;
    +    };
    +

    + Since: + 2.0 +

    +
    +

    +All notifications must have a title attribute. +

    +
    +

    Warning: + Some members of notification could have no effect depending on the device. +

    +
    +

    Constructors

    +
    StatusNotification(StatusNotificationType statusType, DOMString title, optional StatusNotificationInit? notificationInitDict);
    +
    +
    +

    Attributes

    +
      +
    • + readonly +StatusNotificationType statusType
      + The status notification type. +
      +

      + Since: + 2.0 +

      +
    • +
    • +DOMString iconPath [nullable]
      + The icon path to display in the notification. +
      +

      + Since: + 2.0 +

      +
    • +
    • +DOMString subIconPath [nullable]
      + The sub icon path to display in the notification. +
      +

      + Since: + 2.1 +

      +
    • +
    • long number [nullable]
      The number of events to display in the notification.
      @@ -1125,29 +1902,28 @@ This method has effects when the device has notification LED. 2.2

      -

      Code example:

      -try
      -{
      +

      Code example:

       try
      + {
          var notificationDict =
          {
      -      content: "This is a simple notification.",
      -      iconPath: "images/image1.jpg",
      -      soundPath: "music/Over the horizon.mp3",
      -      vibration: true,
      -      ledColor: "#FFFF00",
      -      ledOnPeriod: 1000,
      -      ledOffPeriod: 500
      +     content: "This is a simple notification.",
      +     iconPath: "images/image1.jpg",
      +     soundPath: "music/Over the horizon.mp3",
      +     vibration: true,
      +     ledColor: "#FFFF00",
      +     ledOnPeriod: 1000,
      +     ledOffPeriod: 500
          };
       
          var notification = new tizen.StatusNotification("SIMPLE", "Simple notification", notificationDict);
       
          tizen.notification.post(notification);
      -}
      -catch (err)
      -{
      + }
      + catch (err)
      + {
          console.log(err.name + ": " + err.message);
      -}
      -
      + } +
    • @@ -1229,30 +2005,29 @@ The maximum number of thumbnail path elements in the array is 4. 2.0

      -

      Code example:

      -try
      -{
      +

      Code example:

       try
      + {
          /* Gets the current application information with tizen.application.getAppInfo */
          var myappInfo = tizen.application.getAppInfo();
       
          var notificationDict =
          {
      -      content: "This is a simple notification.",
      -      iconPath: "images/image1.jpg",
      -      soundPath: "music/Over the horizon.mp3",
      -      vibration: true,
      -      appId: myappInfo.id
      +     content: "This is a simple notification.",
      +     iconPath: "images/image1.jpg",
      +     soundPath: "music/Over the horizon.mp3",
      +     vibration: true,
      +     appId: myappInfo.id
          };
       
          var notification = new tizen.StatusNotification("SIMPLE", "Simple notification", notificationDict);
       
          tizen.notification.post(notification);
      -}
      -catch (err)
      -{
      + }
      + catch (err)
      + {
          console.log(err.name + ": " + err.message);
      -}
      -
      + } +
    • @@ -1288,20 +2063,19 @@ Range of progressValue: percent (0 to 100). 2.0

      -

      Code example:

      -try
      -{
      +

      Code example:

       try
      + {
          var appControl = new tizen.ApplicationControl("http://tizen.org/appcontrol/operation/create_content",
                                                        null, "image/jpg", null);
       
          var notificationDict =
          {
      -      content: "This is a progress notification.",
      -      iconPath: "images/image2.jpg",
      -      soundPath: "music/Over the horizon.mp3",
      -      vibration: true,
      -      appControl: appControl,
      -      progressValue: 20
      +     content: "This is a progress notification.",
      +     iconPath: "images/image2.jpg",
      +     soundPath: "music/Over the horizon.mp3",
      +     vibration: true,
      +     appControl: appControl,
      +     progressValue: 20
          };
          /* Constructs the progress notification */
          var notification = new tizen.StatusNotification("PROGRESS", "Progress notification", notificationDict);
      @@ -1311,19 +2085,319 @@ try
          /* Updates the progress value of the notification */
          notification.progressValue = 59;
          tizen.notification.update(notification);
      -}
      -catch (err)
      -{
      + }
      + catch (err)
      + {
          console.log(err.name + ": " + err.message);
      -}
      -
      + } +
      +
      +
    • +
    +
    +
    +
    +

    2.13. UserNotification

    +
    + The UserNotification interface represents a notification and offers additional attributes to represent a notification displayed in the notification tray. +
    +
        [Constructor(UserNotificationType userType, DOMString title, optional UserNotificationInit? notificationGropedInitDict)]
    +    interface UserNotification : Notification {
    +
    +    readonly attribute UserNotificationType userType;
    +
    +    attribute NotificationTextContentInfo? textContents;
    +
    +    attribute NotificationImageInfo? images;
    +
    +    attribute NotificationThumbnailInfo? thumbnails;
    +
    +    attribute NotificationActionInfo? actions;
    +
    +    attribute NotificationGroupContentInfo? groupContents;
    +
    +    attribute NotificationLedInfo? leds;
    +    };
    +

    + Since: + 4.0 +

    +
    +

    +All notifications must have a title attribute. +

    +
    +

    Warning: + Some members of notification could have no effect depending on the device. +

    +
    +

    Constructors

    +
    UserNotification(UserNotificationType userType, DOMString title, optional UserNotificationInit? notificationGropedInitDict);
    +
    +
    +

    Attributes

    +
      +
    • + readonly +UserNotificationType userType
      + The type of notification. +
      +

      + Since: + 4.0 +

      +
    • +
    • +NotificationTextContentInfo textContents [nullable]
      + Defines content-related settings of a notification. +
      +
      +

      +If this is null, all property values of a NotificationTextContentInfo dictionary are ignored. +

      +
      +

      + Since: + 4.0 +

      +
      +

      Code example:

       try
      + {
      +   var notificationGroupDict =
      +   {
      +     content: "This is a progress notification.",
      +     textContents:
      +     {
      +       progressValue: 20
      +     }
      +   };
      +
      +   /* Constructs the progress notification */
      +   var notification = new tizen.UserNotification("PROGRESS", "Progress notification", notificationGroupDict);
      +   /* Posts the notification */
      +   tizen.notification.post(notification);
      +
      +   /* Updates the progress value of the notification */
      +   notification.textContents.progressValue = 59;
      +   tizen.notification.update(notification);
      + }
      + catch (err)
      + {
      +   console.log(err.name + ": " + err.message);
      + }
      + 
      +
      +
    • +
    • +NotificationImageInfo images [nullable]
      + Defines additional image-related settings of a notification. +
      +
      +

      +If this is null, all property values of a NotificationImageInfo dictionary are ignored. +

      +
      +

      + Since: + 4.0 +

      +
      +

      Code example:

       try
      + {
      +   var notificationGroupDict =
      +   {
      +     content: "This is a SIMPLE notification with icon.",
      +     images:
      +     {
      +       iconPath: "images/image2.jpg"
      +     }
      +   };
      +
      +   /* Constructs the simple notification */
      +   var notification = new tizen.UserNotification("SIMPLE", "Simple notification", notificationGroupDict);
      +   /* Posts the notification */
      +   tizen.notification.post(notification);
      + }
      + catch (err)
      + {
      +   console.log(err.name + ": " + err.message);
      + }
      + 
      +
      +
    • +
    • +NotificationThumbnailInfo thumbnails [nullable]
      + Defines additional thumbnails-related settings of a notification. +
      +
      +

      +If this is null, all property values of a NotificationThumbnailInfo dictionary are ignored. +

      +
      +

      + Since: + 4.0 +

      +
      +

      Code example:

       try
      + {
      +   var notificationGroupDict =
      +   {
      +     content: "This is an ongoing notification with tumbnail and icon",
      +     images:
      +     {
      +       iconPath: "images/image2.jpg"
      +     },
      +     thumbnails:
      +     {
      +       thumbnailIconPath: "images/thumbnail.jpg"
      +     }
      +   };
      +
      +   /* Constructs the ongoing notification */
      +   var notification = new tizen.UserNotification("ONGOING", "Ongoing notification", notificationGroupDict);
      +   /* Posts the notification */
      +   tizen.notification.post(notification);
      + }
      + catch (err)
      + {
      +   console.log(err.name + ": " + err.message);
      + }
      + 
      +
      +
    • +
    • +NotificationActionInfo actions [nullable]
      + Defines additional actions-related settings of a notification. +
      +
      +

      +If this is null, all property values of a NotificationActionInfo dictionary are ignored. +

      +
      +

      + Since: + 4.0 +

      +
      +

      Code example:

       try
      + {
      +   var appControl = new tizen.ApplicationControl("http://tizen.org/appcontrol/operation/create_content",
      +                                                 null, "image/jpg", null);
      +
      +   var notificationGroupDict =
      +   {
      +     content: "This is a progress notification with sound and appcontrol",
      +     images:
      +     {
      +       iconPath: "images/image2.jpg"
      +     },
      +     actions:
      +     {
      +       soundPath: "music/Over the horizon.mp3",
      +       vibration: true,
      +       appControl: appControl
      +     }
      +   };
      +
      +   /* Constructs the progress notification */
      +   var notification = new tizen.UserNotification("PROGRESS", "Progress notification", notificationGroupDict);
      +   /* Posts the notification */
      +   tizen.notification.post(notification);
      + }
      + catch (err)
      + {
      +   console.log(err.name + ": " + err.message);
      + }
      + 
      +
      +
    • +
    • +NotificationGroupContentInfo groupContents [nullable]
      + Defines additional group-content-related settings of a notification. +
      +
      +

      +If this is null, all property values of a NotificationGroupContentInfo dictionary are ignored. +

      +
      +

      + Since: + 4.0 +

      +
      +

      Code example:

       try
      + {
      +   var notificationGroupDict =
      +   {
      +     content: "This is a progress notification with groupContents",
      +     groupContents:
      +     {
      +       groupTitle: "A group title",
      +       groupContent: "Some group content"
      +     },
      +     images:
      +     {
      +       iconPath: "images/image2.jpg"
      +     }
      +   };
      +
      +   /* Constructs the progress notification with groupContents */
      +   var notification = new tizen.UserNotification("PROGRESS", "Progress notification", notificationGroupDict);
      +   /* Posts the notification */
      +   tizen.notification.post(notification);
      + }
      + catch (err)
      + {
      +   console.log(err.name + ": " + err.message);
      + }
      + 
      +
      +
    • +
    • +NotificationLedInfo leds [nullable]
      + Defines additional LED-related settings of a notification. +
      +
      +

      +If this is null, all property values of a NotificationLedInfo dictionary are ignored. +

      +
      +

      + Since: + 4.0 +

      +
      +

      Code example:

       try
      + {
      +   var notificationGroupDict =
      +   {
      +     content: "This is a SIMPLE notification with blinking LED",
      +     leds:
      +     {
      +       ledColor: "#FFFF00",
      +       ledOnPeriod: 1000,
      +       ledOffPeriod: 500
      +     }
      +   };
      +
      +   /* Constructs the simple notification */
      +   var notification = new tizen.UserNotification("SIMPLE", "Simple notification", notificationGroupDict);
      +   /* Posts the notification */
      +   tizen.notification.post(notification);
      + }
      + catch (err)
      + {
      +   console.log(err.name + ": " + err.message);
      + }
      + 
    -

    2.6. NotificationDetailInfo

    +

    2.14. NotificationDetailInfo

    The NotificationDetailInfo object that contains the detail information of the notification.
    @@ -1338,9 +2412,8 @@ catch (err) 2.1

    -

    Code example:

    -var detailInfo1 = new tizen.NotificationDetailInfo('Missed Call from James', 'Feb 11 2013');
    -notification.detailInfo = [detailInfo1];
    +

    Code example:

     var detailInfo1 = new tizen.NotificationDetailInfo("Missed Call from James", "Feb 11 2013");
    + notification.detailInfo = [detailInfo1];
     
    @@ -1390,7 +2463,7 @@ If an application uses playLEDCustomEffect() or stopLEDCustomEffect(), declare t
  8. http://tizen.org/feature/led
  9. - For more information, see Application Filtering. + For more information, see Application Filtering.

    4. Full WebIDL

    module Notification {
    @@ -1401,6 +2474,8 @@ If an application uses playLEDCustomEffect() or stopLEDCustomEffect(), declare t
     
         enum StatusNotificationType { "SIMPLE", "THUMBNAIL", "ONGOING", "PROGRESS" };
     
    +    enum UserNotificationType { "SIMPLE", "THUMBNAIL", "ONGOING", "PROGRESS" };
    +
         enum NotificationProgressType { "PERCENTAGE",  "BYTE" };
     
         enum LEDCustomFlags {"LED_CUSTOM_DUTY_ON", "LED_CUSTOM_DEFAULT"};
    @@ -1420,23 +2495,22 @@ If an application uses playLEDCustomEffect() or stopLEDCustomEffect(), declare t
     
         void removeAll() raises(WebAPIException);
     
    -    Notification get(NotificationId id) raises(WebAPIException);
    +    Notification getNotification(NotificationId id) raises(WebAPIException);
     
    -    Notification[] getAll() raises(WebAPIException);
    +    Notification[] getAllNotifications() raises(WebAPIException);
     
    -        void playLEDCustomEffect(long timeOn, long timeOff, DOMString color, LEDCustomFlags[] flags) raises(WebAPIException);
    +    void playLEDCustomEffect(long timeOn, long timeOff, DOMString color, LEDCustomFlags[] flags) raises(WebAPIException);
     
    -        void stopLEDCustomEffect() raises(WebAPIException);
    +    void stopLEDCustomEffect() raises(WebAPIException);
     
    -        void saveNotificationAsTemplate(DOMString name, Notification notification) raises(WebAPIException);
    +    void saveNotificationAsTemplate(DOMString name, Notification notification) raises(WebAPIException);
     
    -        Notification createNotificationFromTemplate(DOMString name) raises(WebAPIException);
    +    UserNotification createNotificationFromTemplate(DOMString name) raises(WebAPIException);
         };
     
     
         [NoInterfaceObject] interface Notification {
     
    -
         readonly attribute NotificationId id;
     
         readonly attribute NotificationType type;
    @@ -1446,31 +2520,61 @@ If an application uses playLEDCustomEffect() or stopLEDCustomEffect(), declare t
         attribute DOMString title;
     
         attribute DOMString? content;
    -
         };
     
    -
    -    dictionary StatusNotificationInit {
    +    dictionary UserNotificationInit {
             DOMString? content;
    +        NotificationTextContentInfo? textContents;
    +        NotificationImageInfo? images;
    +        NotificationThumbnailInfo? thumbnails;
    +        NotificationActionInfo? actions;
    +        NotificationGroupContentInfo? groupContents;
    +        NotificationLedInfo? leds;
    +    };
    +    dictionary NotificationTextContentInfo {
    +        NotificationProgressType? progressType;
    +        unsigned long? progressValue;
    +        long? eventsNumber;
    +        NotificationDetailInfo[]? detailInfo;
    +        DOMString[]? buttonsTexts;
    +        DOMString? contentForOff;
    +    };
    +
    +    dictionary NotificationImageInfo {
             DOMString? iconPath;
    +        DOMString? subIconPath;
    +        DOMString? indicatorIconPath;
    +        DOMString? lockScreenIconPath;
    +        DOMString[]? buttonIconPaths;
    +        DOMString? backgroundImagePath;
    +    };
    +
    +    dictionary NotificationThumbnailInfo {
    +        DOMString? lockScreenThumbnailIconPath;
    +        DOMString? thumbnailIconPath;
    +        DOMString[]? thumbnails;
    +    };
    +
    +    dictionary NotificationActionInfo {
             DOMString? soundPath;
             boolean? vibration;
             ApplicationControl? appControl;
             ApplicationId? appId;
    -        NotificationProgressType? progressType;
    -        unsigned long? progressValue;
    -        long? number;
    -        DOMString? subIconPath;
    -        NotificationDetailInfo[]? detailInfo;
    +    };
    +
    +    dictionary NotificationGroupContentInfo {
    +        DOMString? groupTitle;
    +        DOMString? groupContent;
    +        DOMString? groupContentForOff;
    +    };
    +    dictionary NotificationLedInfo {
             DOMString? ledColor;
             unsigned long ledOnPeriod;
             unsigned long ledOffPeriod;
    -        DOMString? backgroundImagePath;
    -        DOMString[]? thumbnails;
         };
     
    -   [Constructor(StatusNotificationType statusType, DOMString title, optional StatusNotificationInit? notificationInitDict)]
     
    +    [Constructor(StatusNotificationType statusType, DOMString title, optional StatusNotificationInit? notificationInitDict)]
     
         interface StatusNotification : Notification {
     
    @@ -1490,21 +2594,39 @@ If an application uses playLEDCustomEffect() or stopLEDCustomEffect(), declare t
     
         attribute unsigned long ledOffPeriod;
     
    -     attribute DOMString? backgroundImagePath;
    +    attribute DOMString? backgroundImagePath;
    +
    +    attribute DOMString[]? thumbnails;
    +
    +    attribute DOMString? soundPath;
    +
    +    attribute boolean vibration;
    +
    +    attribute ApplicationControl? appControl;
    +
    +    attribute ApplicationId? appId;
    +
    +    attribute NotificationProgressType progressType;
    +
    +    attribute unsigned long? progressValue;
    +    };
    +
    +    [Constructor(UserNotificationType userType, DOMString title, optional UserNotificationInit? notificationGropedInitDict)]
    +    interface UserNotification : Notification {
     
    -     attribute DOMString[]? thumbnails;
    +    readonly attribute UserNotificationType userType;
     
    -     attribute DOMString? soundPath;
    +    attribute NotificationTextContentInfo? textContents;
     
    -     attribute boolean vibration;
    +    attribute NotificationImageInfo? images;
     
    -     attribute ApplicationControl? appControl;
    +    attribute NotificationThumbnailInfo? thumbnails;
     
    -     attribute ApplicationId? appId;
    +    attribute NotificationActionInfo? actions;
     
    -     attribute NotificationProgressType progressType;
    +    attribute NotificationGroupContentInfo? groupContents;
     
    -     attribute unsigned long? progressValue;
    +    attribute NotificationLedInfo? leds;
         };
     
         [Constructor(DOMString mainText, optional DOMString? subText)]
    diff --git a/org.tizen.web.apireference/html/device_api/wearable/tizen/notification.html b/org.tizen.web.apireference/html/device_api/wearable/tizen/notification.html
    index b7fa62c..aee4d3f 100755
    --- a/org.tizen.web.apireference/html/device_api/wearable/tizen/notification.html
    +++ b/org.tizen.web.apireference/html/device_api/wearable/tizen/notification.html
    @@ -31,11 +31,17 @@ For more information on the Notification features, see NotificationType
     
    -
  10. +
  11. 1.3. StatusNotificationType
  12. - 1.4. NotificationProgressType + 1.4. UserNotificationType +
  13. +
  14. + 1.5. NotificationProgressType +
  15. +
  16. + 1.6. LEDCustomFlags
  17. @@ -46,15 +52,33 @@ For more information on the Notification features, see Notification -
  18. 2.4. StatusNotificationInit +
  19. 2.4. StatusNotificationInit +
  20. +
  21. 2.5. UserNotificationInit +
  22. +
  23. 2.6. NotificationTextContentInfo +
  24. +
  25. 2.7. NotificationImageInfo
  26. -
  27. 2.5. StatusNotification +
  28. 2.8. NotificationThumbnailInfo
  29. -
  30. 2.6. NotificationDetailInfo +
  31. 2.9. NotificationActionInfo +
  32. +
  33. 2.10. NotificationGroupContentInfo +
  34. +
  35. 2.11. NotificationLedInfo +
  36. +
  37. 2.12. StatusNotification +
  38. +
  39. 2.13. UserNotification +
  40. +
  41. 2.14. NotificationDetailInfo
  42. -
  43. 3. Full WebIDL +
  44. 3. Related Feature +
  45. +
  46. 4. Full WebIDL

  47. @@ -77,12 +101,14 @@ For more information on the Notification features, see remove (NotificationId id)
    void removeAll ()
    +Notification getNotification (NotificationId id)
    +Notification[] getAllNotifications () +
    void playLEDCustomEffect (long timeOn, long timeOff, DOMString color, LEDCustomFlags[] flags)
    +
    void saveNotificationAsTemplate (DOMString name, Notification notification)
    +UserNotification createNotificationFromTemplate (DOMString name) @@ -90,11 +116,35 @@ For more information on the Notification features, see StatusNotificationInit +UserNotificationInit + + + +NotificationTextContentInfo + + + +NotificationImageInfo + + + +NotificationThumbnailInfo + + + +NotificationActionInfo + + + +NotificationGroupContentInfo + + + +NotificationLedInfo -StatusNotification +UserNotification @@ -137,11 +187,14 @@ The status notification consists of an icon, title, content, and time. The statu -
    +

    1.3. StatusNotificationType

    A status notification type.
    +

    Deprecated. + Deprecated since 4.0. Use UserNotificationType instead. +

        enum StatusNotificationType { "SIMPLE", "THUMBNAIL", "ONGOING", "PROGRESS" };

    Since: @@ -159,14 +212,42 @@ THUMBNAIL - The thumbnail status notification posts a thumbnail-format notificat The thumbnail status notification is also removed by user selection.

  48. -ONGOING - A status notification type that informs the user whether an application is running or not. However, an ongoing status notification should be removed by the application that posted the notification.
  49. +ONGOING - A status notification type that informs the user whether an application is running or not.
  50. PROGRESS - A status notification that displays information on the progress of a job. However, this status notification should be removed by the application that posted the notification.
  51. +
    +

    1.4. UserNotificationType

    +
    + A user notification type. +
    +
        enum UserNotificationType { "SIMPLE", "THUMBNAIL", "ONGOING", "PROGRESS" };
    +

    + Since: + 4.0 +

    +
    +

    +The following user notification types are supported: +

    +
      +
    • +SIMPLE - A basic user notification type that is removed automatically when selected by the user. All simple user notifications can be removed by user interaction.
    • +
    • +THUMBNAIL - The thumbnail user notification posts a thumbnail-format notification which includes several thumbnail image paths. +The thumbnail user notification is also removed by user selection. +
    • +
    • +ONGOING - An user notification type that informs the user whether an application is running or not.
    • +
    • +PROGRESS - An user notification that displays information on the progress of a job. However, this user notification should be removed by the application that posted the notification.
    • +
    +
    +
    -

    1.4. NotificationProgressType

    +

    1.5. NotificationProgressType

    A notification progress type.
    @@ -187,6 +268,26 @@ The following notification progress types are supported:
    +
    +

    1.6. LEDCustomFlags

    +
    + Specifies custom LED flags. +The following values are supported in this release : +
    +
        enum LEDCustomFlags {"LED_CUSTOM_DUTY_ON", "LED_CUSTOM_DEFAULT"};
    +

    + Since: + 2.4 +

    +
    +
      +
    • +LED_CUSTOM_DUTY_ON, blink LED
    • +
    • +LED_CUSTOM_DEFAULT, default flag
    • +
    +
    +

    2. Interfaces

    @@ -225,13 +326,17 @@ Notification API. void removeAll() raises(WebAPIException); - Notification get(NotificationId id) raises(WebAPIException); + Notification getNotification(NotificationId id) raises(WebAPIException); + + Notification[] getAllNotifications() raises(WebAPIException); - Notification[] getAll() raises(WebAPIException); + void playLEDCustomEffect(long timeOn, long timeOff, DOMString color, LEDCustomFlags[] flags) raises(WebAPIException); + + void stopLEDCustomEffect() raises(WebAPIException); void saveNotificationAsTemplate(DOMString name, Notification notification) raises(WebAPIException); - Notification createNotificationFromTemplate(DOMString name) raises(WebAPIException); + UserNotification createNotificationFromTemplate(DOMString name) raises(WebAPIException); };

    Since: @@ -279,9 +384,6 @@ The NotificationManager interface provides access to the notification object.

    Exceptions:

    • WebAPIException
      • - with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter. -

      • -
      • with error type InvalidValuesError, if any of the input parameters contain an invalid value.

      • @@ -289,35 +391,111 @@ parameters contain an invalid value. with error type SecurityError, if the application does not have the privilege to call this method.

      • + with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter. +

      • +
      • with error type UnknownError, if any other error occurs.

    -

    Code example:

    -try
    -{
    -   var appControl = new tizen.ApplicationControl("http://tizen.org/appcontrol/operation/create_content",
    +

    Code example:

     try
    + {
    +   var appControl = new tizen.ApplicationControl("http://tizen.org/appcontrol/operation/view",
                                                      null, "image/jpg", null);
    -   var notificationDict =
    +
    +   var notificationGroupDict =
        {
    -      content: "This is a simple notification.",
    -      iconPath: "images/image1.jpg",
    -      soundPath: "music/Over the horizon.mp3",
    -      vibration: true,
    -      appControl: appControl
    +     content: "This is a simple user notification.",
    +     actions:
    +     {
    +       soundPath: "music/Over the horizon.mp3",
    +       vibration: true,
    +       appControl: appControl
    +     }
        };
     
    -   var notification = new tizen.StatusNotification("SIMPLE", "Simple notification", notificationDict);
    +   /* Constructs and posts the simple user notification */
    +   var notification = new tizen.UserNotification("SIMPLE", "User notification", notificationGroupDict);
    +   tizen.notification.post(notification);
    + }
    + catch (err)
    + {
    +   console.log(err.name + ": " + err.message);
    + }
    + 
    +
    +
    +

    Code example:

     try
    + {
    +   var notificationGroupDict =
    +   {
    +     content: "This is a thumbnail user notification.",
    +     thumbnails:
    +     {
    +       thumbnailIconPath: "images/thumbnail.jpg"
    +     }
    +   };
     
    +   /* Constructs and posts the thumbnail user notification */
    +   var notification = new tizen.UserNotification("THUMBNAIL", "User notification", notificationGroupDict);
        tizen.notification.post(notification);
    -}
    -catch (err)
    -{
    + }
    + catch (err)
    + {
        console.log(err.name + ": " + err.message);
    -}
    -
    + } + +
    +
    +

    Code example:

     try
    + {
    +   var notificationGroupDict =
    +   {
    +     content: "This is an ongoing user notification.",
    +     images:
    +     {
    +       iconPath: "images/simple_icon.jpg"
    +     }
    +   };
    +
    +   /* Constructs and posts the ongoing user notification. */
    +   var notification = new tizen.UserNotification("ONGOING", "User notification", notificationGroupDict);
    +   tizen.notification.post(notification);
    + }
    + catch (err)
    + {
    +   console.log(err.name + ": " + err.message);
    + }
    + 
    +
    +
    +

    Code example:

     try
    + {
    +   var notificationGroupDict =
    +   {
    +     content: "This is a progress user notification.",
    +     textContents:
    +     {
    +       progressValue: 20
    +     },
    +     actions:
    +     {
    +       soundPath: "music/Over the horizon.mp3",
    +       vibration: false
    +     }
    +   };
    +
    +   /* Constructs and posts the progress user notification */
    +   var notification = new tizen.UserNotification("PROGRESS", "User notification", notificationGroupDict);
    +   tizen.notification.post(notification);
    + }
    + catch (err)
    + {
    +   console.log(err.name + ": " + err.message);
    + }
    + 
    @@ -354,9 +532,6 @@ catch (err)

    Exceptions:

    • WebAPIException
      • - with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter. -

      • -
      • with error type InvalidValuesError, if any of the input parameters contain an invalid value.

      • @@ -364,24 +539,26 @@ parameters contain an invalid value. with error type SecurityError, if the application does not have the privilege to call this method.

      • + with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter. +

      • +
      • with error type UnknownError, if any other error occurs.

    -

    Code example:

    -try
    -{
    +

    Code example:

     try
    + {
        /* Uses a variable for the previously posted notification */
        notification.content = "My notification";
        tizen.notification.update(notification);
    -}
    -catch (err)
    -{
    + }
    + catch (err)
    + {
        console.log(err.name + ": " + err.message);
    -}
    -
    + } +
    @@ -418,32 +595,31 @@ catch (err)

    Exceptions:

    • WebAPIException
      • - with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter. -

      • -
      • with error type NotFoundError, if NotificationId is not found in the previously posted notification.

      • with error type SecurityError, if the application does not have the privilege to call this method.

      • + with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter. +

      • +
      • with error type UnknownError, if any other error occurs.

    -

    Code example:

    -try
    -{
    +

    Code example:

     try
    + {
        /* Uses a variable for the previously posted notification */
        tizen.notification.remove(notification.id);
    -}
    -catch (err)
    -{
    + }
    + catch (err)
    + {
        console.log(err.name + ": " + err.message);
    -}
    -
    + } +
    @@ -480,30 +656,35 @@ catch (err)
    -

    Code example:

    -try
    -{
    +

    Code example:

     try
    + {
        tizen.notification.removeAll();
    -}
    -catch (err)
    -{
    + }
    + catch (err)
    + {
        console.log(err.name + ": " + err.message);
    -}
    -
    + } +
    -
    +
    get
    -
    +
    Gets a notification that has previously been posted by the current application. Note that the obtained notification's progressType is PERCENTAGE
    +

    Deprecated. + Deprecated since 4.0. Use getNotification instead. +

    Since: 2.3.1

    +

    Remark : + This method is designed to return old-style notification. +

    Parameters:

      @@ -526,34 +707,92 @@ catch (err)
    -

    Code example:

    -try
    -{
    +

    Code example:

     try
    + {
        /* Uses a variable for the previously posted notification */
        /* Saves the notification ID for future use */
        var myId = notification.id;
     
        var myNotification = tizen.notification.get(myId);
    -}
    -catch (err)
    -{
    + }
    + catch (err)
    + {
        console.log(err.name + ": " + err.message);
    -}
    -
    + } +
    -
    -getAll +
    +getNotification
    + Gets a notification that has previously been posted by the current application. Note that the obtained notification's progressType is PERCENTAGE. +
    +
    Notification getNotification(NotificationId id);
    +             
    +

    + Since: + 4.0 +

    +

    Remark : + This method is designed to return new representation of a notification. +

    +
    +

    Parameters:

    +
      +
    • +id: + A previously posted notification ID. +
    • +
    +
    +
    +

    Exceptions:

    +
    • WebAPIException
        +
      • + with error type NotFoundError, if NotificationId is not found in the previously posted notifications. +

      • +
      • + with error type AbortError, if any other error occurs. +

      • +
      +
    +
    +
    +

    Code example:

     try
    + {
    +   /* Uses a variable for the previously posted notification */
    +   /* Saves the notification ID for future use */
    +   var myId = notification.id;
    +
    +   var myNotification = tizen.notification.getNotification(myId);
    + }
    + catch (err)
    + {
    +   console.log(err.name + ": " + err.message);
    + }
    + 
    +
    +
    +
    +getAll +
    +
    +
    Gets all notifications that have previously been posted by the current application. Note that the obtained notification's progressType is PERCENTAGE
    +

    Deprecated. + Deprecated since 4.0. Use getAllNotifications instead. +

    Notification[] getAll();
                  

    Since: 2.3.1

    +

    Remark : + This method is designed to return old-style notifications. +

    Exceptions:

    • WebAPIException
      • @@ -562,52 +801,97 @@ catch (err)

    -

    Code example:

    -try
    -{
    +

    Code example:

     try
    + {
        var notifications = tizen.notification.getAll();
    -   var index = 0;
     
    -   for (index = 0; index < notifications.length; index++)
    +   for (var index = 0; index < notifications.length; index++)
        {
    -      console.log(notifications[index].id);
    -      console.log(notifications[index].title);
    -      console.log(notifications[index].statusType);
    -      console.log(notifications[index].type);
    -      console.log(notifications[index].content);
    -      console.log(notifications[index].postedTime);
    -      console.log(notifications[index].iconPath);
    -      console.log(notifications[index].soundPath);
    -      console.log(notifications[index].vibration);
    -      console.log(notifications[index].appControl);
    +     console.log(notifications[index].id);
    +     console.log(notifications[index].title);
    +     console.log(notifications[index].statusType);
    +     console.log(notifications[index].type);
    +     console.log(notifications[index].content);
    +     console.log(notifications[index].postedTime);
    +     console.log(notifications[index].iconPath);
    +     console.log(notifications[index].soundPath);
    +     console.log(notifications[index].vibration);
    +     console.log(notifications[index].appControl);
        }
    -}
    -catch (err)
    -{
    + }
    + catch (err)
    + {
        console.log(err.name + ": " + err.message);
    -
    + } +
    -
    -saveNotificationAsTemplate + +
    +getAllNotifications
    - Saves a notification template to the notification database. + Gets all notifications that have previously been posted by the current application. Note that the obtained notification's progressType is PERCENTAGE.
    -
    void saveNotificationAsTemplate(DOMString name, Notification notification);
    +
    Notification[] getAllNotifications();
                  

    Since: 4.0

    -
    -

    -An application can save the created notification as a template for later reuse. -If the template has the same name as a saved one, the saved template will be overwritten. +

    Remark : + This method is designed to return new representation of a notifications. +

    +
    +

    Exceptions:

    +
    • WebAPIException
      • + with error type AbortError, if any error occurs. +

      +
    +
    +
    +

    Code example:

     try
    + {
    +   var notifications = tizen.notification.getAllNotifications();
    +
    +   for (var index = 0; index < notifications.length; index++)
    +   {
    +     console.log(notifications[index].id);
    +     console.log(notifications[index].type);
    +     console.log(notifications[index].userType);
    +     console.log(notifications[index].content);
    +     console.log(notifications[index].postedTime);
    +     console.log(notifications[index].images.iconPath);
    +     console.log(notifications[index].actions.soundPath);
    +     console.log(notifications[index].actions.vibration);
    +     console.log(notifications[index].actions.appControl);
    +   }
    + }
    + catch (err)
    + {
    +   console.log(err.name + ": " + err.message);
    + }
    + 
    +
    +
    +
    +playLEDCustomEffect +
    +
    +
    + Plays the custom effect of the service LED that is located to the front of a device. +
    +
    void playLEDCustomEffect(long timeOn, long timeOff, DOMString color, LEDCustomFlags[] flags);
    +             
    +

    + Since: + 2.4

    +

    -A saved template can be loaded only by the application which saved it. -All templates are removed when the application package is uninstalled. +Given parameters consist of timeOn and timeOff in miliseconds, RGBA color and LEDCustomFlags combination. +For the color first three bytes are RGB values. The last byte is opacity. For example "#FFFF0080". There is also another possibility when the last byte +is not given (in this case alpha is assumed to have value 0xff). In this case only RGB values are given. For example: "#ff0000" that is equivalent of "#ff0000ff".

    @@ -616,21 +900,26 @@ All templates are removed when the application package is uninstalled.

    Privilege: - http://tizen.org/privilege/notification -

    -

    Remark : - The number of templates is limited to 10. When you try to add more than 10 templates, exception is thrown. + http://tizen.org/privilege/led

    Parameters:

    • -name: - The name of template to be saved. +timeOn: + Turn on time in milliseconds
    • -notification: - A notification to be saved as a template. +timeOff: + Turn off time in milliseconds +
    • +
    • +color: + The RGBA color value. The first three bytes are RGB values. The last byte is opacity. Exemplary string "#FFFF0080". +
    • +
    • +flags: + The combination of enum LEDCustomFlags
    @@ -638,114 +927,254 @@ All templates are removed when the application package is uninstalled.

    Exceptions:

    • WebAPIException
      • - with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter. + with error type InvalidValuesError, if any of the input parameters contain an invalid value.

      • - with error type SecurityError, if the application does not have the privilege to call this method. + with error type SecurityError, if the application does not have the privilege to call this method or if the author signature does not match that of the designated application.

      • - with error type QuotaExceededError, if the allowed number of templates is exceeded. + with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter

      • - with error type AbortError, if the method cannot be completed because of any error. + with error type UnknownError, if the method cannot be completed because of an unknown error.

    -

    Code example:

    -try {
    -    var notificationDict = {
    -                content : "This is a simple notification.",
    -                iconPath : "images/image1.jpg",
    -                soundPath : "music/Over the horizon.mp3",
    -                vibration : true
    -    };
    -
    -    var notification = new tizen.StatusNotification("SIMPLE",
    -                "Simple notification", notificationDict);
    -
    -    tizen.notification.saveNotificationAsTemplate("SIMPLE_TEMPLATE", notification);
    -} catch (err) {
    -    console.log(err.name + ": " + err.message);
    -}
    -
    +

    Code example:

     try
    + {
    +   tizen.notification.playLEDCustomEffect(1000, 1000, "#FFFF0080", ["LED_CUSTOM_DUTY_ON", "LED_CUSTOM_DEFAULT"]);
    + }
    + catch (err)
    + {
    +   console.log("Error Exception, error name : " + err.name + ", error message : " + err.message);
    + }
    + 
    -
    -createNotificationFromTemplate +
    +stopLEDCustomEffect
    - Creates notification based on previously created template. + Stops the custom effect of the service LED that is located to the front of a device.
    -
    Notification createNotificationFromTemplate(DOMString name);
    +
    void stopLEDCustomEffect();
                  

    Since: - 4.0 -

    -
    -

    -An application can load a saved template and post it. -An application can load only templates that it has saved. + 2.4

    -

    Privilege level: public

    Privilege: - http://tizen.org/privilege/notification + http://tizen.org/privilege/led

    -
    -

    Parameters:

    -
      -
    • -name: - The name of template to be used as source of notification. -
    • -
    -

    Exceptions:

    • WebAPIException
      • - with error type SecurityError, if the application does not have the privilege to call this method. -

      • -
      • - with error type NotFoundError, if the method cannot find a template with given name. + with error type SecurityError, if the application does not have the privilege to call this method.

      • - with error type AbortError, if the method cannot be completed because of any error. + with error type UnknownError, if the method cannot be completed because of an unknown error.

    -

    Code example:

    -/* the template with name "SIMPLE_TEMPLATE" should be previously created */
    -try {
    -    var notification = tizen.notification.createNotificationFromTemplate("SIMPLE_TEMPLATE");
    -} catch (err) {
    -     console.log(err.name + ": " + err.message);
    -}
    -
    +

    Code example:

     try
    + {
    +   tizen.notification.playLEDCustomEffect(1000, 1000, "#FFFF0080", ["LED_CUSTOM_DUTY_ON", "LED_CUSTOM_DEFAULT"]);
    +   setTimeout(function()
    +   {
    +     tizen.notification.stopLEDCustomEffect();
    +   }, 5000);
    + }
    + catch (err)
    + {
    +   console.log("Error Exception, error name : " + err.name + ", error message : " + err.message);
    + }
    + 
    - - - -
    -

    2.3. Notification

    +
    +saveNotificationAsTemplate +
    +
    - The Notification interface offers common attributes to represent the Notification object. -
    -
        [NoInterfaceObject] interface Notification {
    -
    -
    -    readonly attribute NotificationId id;
    + Saves a notification template to the notification database.
    +            
    +
    void saveNotificationAsTemplate(DOMString name, Notification notification);
    +             
    +

    + Since: + 4.0 +

    +
    +

    +An application can save the created notification as a template for later reuse. +If the template has the same name as a saved one, the saved template will be overwritten. +

    +

    +A saved template can be loaded only by the application which saved it. +All templates are removed when the application package is uninstalled. +

    +
    +

    + Privilege level: + public +

    +

    + Privilege: + http://tizen.org/privilege/notification +

    +

    Remark : + The number of templates is limited to 10. When you try to add more than 10 templates, exception is thrown. +

    +
    +

    Parameters:

    +
      +
    • +name: + The name of template to be saved. +
    • +
    • +notification: + A notification to be saved as a template. +
    • +
    +
    +
    +

    Exceptions:

    +
    • WebAPIException
        +
      • + with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter. +

      • +
      • + with error type SecurityError, if the application does not have the privilege to call this method. +

      • +
      • + with error type QuotaExceededError, if the allowed number of templates is exceeded. +

      • +
      • + with error type AbortError, if the method cannot be completed because of any error. +

      • +
      +
    +
    +
    +

    Code example:

     try
    + {
    +   var notificationGroupDict =
    +   {
    +     content: "This is a progress notification.",
    +     images:
    +     {
    +       iconPath: "images/image2.jpg"
    +     },
    +     actions:
    +     {
    +       soundPath: "music/Over the horizon.mp3",
    +       vibration: true
    +     }
    +   };
    +
    +   /* Constructs the progress notification */
    +   var notification = new tizen.UserNotification("PROGRESS", "Progress notification", notificationGroupDict);
    +
    +   tizen.notification.saveNotificationAsTemplate("PROGRESS_TEMPLATE", notification);
    + }
    + catch (err)
    + {
    +   console.log(err.name + ": " + err.message);
    + }
    + 
    +
    + +
    +createNotificationFromTemplate +
    +
    +
    + Creates notification based on previously created template. +
    +
    UserNotification createNotificationFromTemplate(DOMString name);
    +             
    +

    + Since: + 4.0 +

    +
    +

    +An application can load a saved template and post it. +An application can load only templates that it has saved. +

    +
    +

    + Privilege level: + public +

    +

    + Privilege: + http://tizen.org/privilege/notification +

    +

    Remark : + This method is designed to return only UserNotification objects, even if the template was saved as StatusNotification. +

    +
    +

    Parameters:

    +
      +
    • +name: + The name of template to be used as source of notification. +
    • +
    +
    +
    +

    Exceptions:

    +
    • WebAPIException
        +
      • + with error type SecurityError, if the application does not have the privilege to call this method. +

      • +
      • + with error type NotFoundError, if the method cannot find a template with given name. +

      • +
      • + with error type AbortError, if the method cannot be completed because of any error. +

      • +
      +
    +
    +
    +

    Code example:

     /* the template with name "SIMPLE_TEMPLATE" should be previously created */
    + try
    + {
    +   var notification = tizen.notification.createNotificationFromTemplate("SIMPLE_TEMPLATE");
    +   console.log("UserNotification - " + notification.title);
    + }
    + catch (err)
    + {
    +   console.log(err.name + ": " + err.message);
    + }
    + 
    +
    +
    + + + +
    +

    2.3. Notification

    +
    + The Notification interface offers common attributes to represent the Notification object. +
    +
        [NoInterfaceObject] interface Notification {
    +
    +    readonly attribute NotificationId id;
     
         readonly attribute NotificationType type;
     
    @@ -754,7 +1183,6 @@ try {
         attribute DOMString title;
     
         attribute DOMString? content;
    -
         };

    Since: @@ -790,65 +1218,573 @@ try {

    Since: - 2.3.1 + 2.3.1 +

    + +
  52. +DOMString title
    + The title to display in a notification. +
    +

    + Since: + 2.3.1 +

    +
  53. +
  54. +DOMString content [nullable]
    + The content to display in a notification. +
    +

    + Since: + 2.3.1 +

    +
  55. + + + +
    +

    2.4. StatusNotificationInit

    +
    + The properties of StatusNotification, to pass to the constructor. +
    +

    Deprecated. + Deprecated since 4.0. Use UserNotificationInit instead. +

    +
        dictionary StatusNotificationInit {
    +        DOMString? content;
    +        DOMString? iconPath;
    +        DOMString? soundPath;
    +        boolean? vibration;
    +        ApplicationControl? appControl;
    +        ApplicationId? appId;
    +        NotificationProgressType? progressType;
    +        unsigned long? progressValue;
    +        long? number;
    +        DOMString? subIconPath;
    +        NotificationDetailInfo[]? detailInfo;
    +        DOMString? ledColor;
    +        unsigned long ledOnPeriod;
    +        unsigned long ledOffPeriod;
    +        DOMString? backgroundImagePath;
    +        DOMString[]? thumbnails;
    +    };
    +

    + Since: + 2.3.1 +

    +
    +
    +

    2.5. UserNotificationInit

    +
    + The properties of UserNotification, to pass to the constructor, grouped by its functions. +
    +
        dictionary UserNotificationInit {
    +        DOMString? content;
    +        NotificationTextContentInfo? textContents;
    +        NotificationImageInfo? images;
    +        NotificationThumbnailInfo? thumbnails;
    +        NotificationActionInfo? actions;
    +        NotificationGroupContentInfo? groupContents;
    +        NotificationLedInfo? leds;
    +    };
    +

    + Since: + 4.0 +

    +
    +

    +For detailed descriptions of properties, please refer to Notification and UserNotification. +

    +
    +

    Remark : + Some of the specified options might be ignored if the device does not support related feature (e.g. LED notification settings). +

    +
    +
    +

    2.6. NotificationTextContentInfo

    +
    + Additional properties of UserNotification. These properties are used for modifying values contained in a notification. +
    +
        dictionary NotificationTextContentInfo {
    +        NotificationProgressType? progressType;
    +        unsigned long? progressValue;
    +        long? eventsNumber;
    +        NotificationDetailInfo[]? detailInfo;
    +        DOMString[]? buttonsTexts;
    +        DOMString? contentForOff;
    +    };
    +

    + Since: + 4.0 +

    +

    Remark : + Some members of notification could have no effect depending on the device. +

    +
    +

    Dictionary members

    +
    +
    NotificationProgressType? progressType
    +
    +
    + Defines the type for a PROGRESS notification's progress. +By default, this attribute is set to PERCENTAGE. +
    +

    + Since: + 4.0 +

    +
    +
    unsigned long? progressValue
    +
    +
    + Defines the current notification progress value (PERCENTAGE or BYTE), depending on the progressType
    +
    +

    +If progressValue is set, the progressbar will be displayed in the notification. The progressValue can change the amount of progress as it moves forward or backward. It gets the progress value of the current notification. +If 0, the indeterminate progressbar will be shown. +This attribute only affects for UserNotification of type PROGRESS. +

    +

    +Applications should keep the progress value for its job because +the saved value in the notification status tray can be different from +the exact progress value. +

    +

    +Range of progressValue for PERCENTAGE progressType is from 0 to 100. +

    +
    +

    + Since: + 4.0 +

    +
    +

    Code example:

     try
    + {
    +   var appControl = new tizen.ApplicationControl("http://tizen.org/appcontrol/operation/create_content",
    +                                                 null, "image/jpg", null);
    +
    +   var notificationGroupDict =
    +   {
    +     content: "This is a progress notification.",
    +     textContents:
    +     {
    +       progressValue: 20
    +     },
    +     images:
    +     {
    +       iconPath: "images/image2.jpg"
    +     },
    +     actions:
    +     {
    +       soundPath: "music/Over the horizon.mp3",
    +       vibration: true,
    +       appControl: appControl
    +     }
    +   };
    +
    +   /* Constructs the progress notification */
    +   var notification = new tizen.UserNotification("PROGRESS", "Progress notification", notificationGroupDict);
    +   /* Posts the notification */
    +   tizen.notification.post(notification);
    +
    +   /* Updates the progress value of the notification */
    +   notification.textContents.progressValue = 59;
    +   tizen.notification.update(notification);
    + }
    + catch (err)
    + {
    +   console.log(err.name + ": " + err.message);
    + }
    + 
    +
    +
    +
    long? eventsNumber
    +
    +
    + The number of events to display in the notification. +
    +

    + Since: + 4.0 +

    +
    +
    NotificationDetailInfo[]? detailInfo
    +
    +
    + Appends lines of the detail information to the notification. +This attribute is available in a simple status notification. +
    +
    +

    +By default, this attribute is initialized with an empty array. +The maximum number of detail information elements in the array is 2. +

    +
    +

    + Since: + 4.0 +

    +
    +
    DOMString[]? buttonsTexts
    +
    +
    + The text for buttons. +
    +

    + Since: + 4.0 +

    +
    +
    DOMString? contentForOff
    +
    +
    + The content to show when the option to display content is off in the Settings. +
    +

    + Since: + 4.0 +

    +
    +
    +
    +
    +
    +

    2.7. NotificationImageInfo

    +
    + Additional properties of UserNotification. These properties are used for modifying the appearance of a notification. +
    +
        dictionary NotificationImageInfo {
    +        DOMString? iconPath;
    +        DOMString? subIconPath;
    +        DOMString? indicatorIconPath;
    +        DOMString? lockScreenIconPath;
    +        DOMString[]? buttonIconPaths;
    +        DOMString? backgroundImagePath;
    +    };
    +

    + Since: + 4.0 +

    +

    Remark : + Some members of notification could have no effect depending on the device. +

    +
    +

    Dictionary members

    +
    +
    DOMString? iconPath
    +
    +
    + The icon path to display in the notification. +
    +

    + Since: + 4.0 +

    +
    +
    DOMString? subIconPath
    +
    +
    + The sub icon path to display in the notification. +
    +

    + Since: + 4.0 +

    +
    +
    DOMString? indicatorIconPath
    +
    +
    + The path for the indicator icon. +
    +

    + Since: + 4.0 +

    +
    +
    DOMString? lockScreenIconPath
    +
    +
    + The path for the lock screen icon. +
    +

    + Since: + 4.0 +

    +
    +
    DOMString[]? buttonIconPaths
    +
    +
    + The paths for button icons. +
    +

    + Since: + 4.0 +

    +
    +
    DOMString? backgroundImagePath
    +
    +
    + The image path to use as the background of the notification. +This attribute is available on simple or thumbnail status notifications. +
    +

    + Since: + 4.0 +

    +
    +
    +
    +
    +
    +

    2.8. NotificationThumbnailInfo

    +
    + Additional properties of UserNotification. These properties are used for modifying the thumbnails of a notification. +
    +
        dictionary NotificationThumbnailInfo {
    +        DOMString? lockScreenThumbnailIconPath;
    +        DOMString? thumbnailIconPath;
    +        DOMString[]? thumbnails;
    +    };
    +

    + Since: + 4.0 +

    +

    Remark : + Some members of notification could have no effect depending on the device. +

    +
    +

    Dictionary members

    +
    +
    DOMString? lockScreenThumbnailIconPath
    +
    +
    + The path for the lock screen thumbnail icon. +
    +

    + Since: + 4.0 +

    +
    +
    DOMString? thumbnailIconPath
    +
    +
    + The path for the thumbnail icon. +
    +

    + Since: + 4.0 +

    +
    +
    DOMString[]? thumbnails
    +
    +
    + The image paths associated with the thumbnail status notification. +
    +
    +

    +By default, this attribute is initialized with an empty array. +The maximum number of thumbnail path elements in the array is 4. +

    +
    +

    + Since: + 4.0 +

    +
    +
    +
    +
    +
    +

    2.9. NotificationActionInfo

    +
    + Additional properties of UserNotification. These properties are used for modifying the actions related to the notification. +
    +
        dictionary NotificationActionInfo {
    +        DOMString? soundPath;
    +        boolean? vibration;
    +        ApplicationControl? appControl;
    +        ApplicationId? appId;
    +    };
    +

    + Since: + 4.0 +

    +

    Remark : + Some members of notification could have no effect depending on the device. +

    +
    +

    Dictionary members

    +
    +
    DOMString? soundPath
    +
    +
    + The path of a sound file to play when the notification is shown. +
    +

    + Since: + 4.0 +

    +
    +
    boolean? vibration
    +
    +
    + Checks whether to vibrate when the notification is shown. By default, this attribute is set to false. +
    +

    + Since: + 4.0 +

    +
    +
    ApplicationControl? appControl
    +
    +
    + Holds the application control to launch an application when the notification is selected from the notification tray. +
    +

    + Since: + 4.0 +

    +
    +
    ApplicationId? appId
    +
    +
    + Holds the application ID to launch when the notification is selected from the notification tray. +
    +

    + Since: + 4.0 +

    +
    +
    +
    +
    +
    +

    2.10. NotificationGroupContentInfo

    +
    + Additional properties of UserNotification. These properties are used for modifying the appearance of group content of a notification. +
    +
        dictionary NotificationGroupContentInfo {
    +        DOMString? groupTitle;
    +        DOMString? groupContent;
    +        DOMString? groupContentForOff;
    +    };
    +

    + Since: + 4.0 +

    +

    Remark : + Some members of notification could have no effect depending on the device. +

    +
    +

    Dictionary members

    +
    +
    DOMString? groupTitle
    +
    +
    + The group title. +
    +

    + Since: + 4.0 +

    +
    +
    DOMString? groupContent
    +
    +
    + The group content. +
    +

    + Since: + 4.0 +

    +
    +
    DOMString? groupContentForOff
    +
    +
    + The group content to show when the option to display content is off in the Settings. +
    +

    + Since: + 4.0 +

    +
    +
    +
    +
    +
    +

    2.11. NotificationLedInfo

    +
    + Additional properties of UserNotification. These properties are used for modifying the LED behaviour of a notification. +
    +
        dictionary NotificationLedInfo {
    +        DOMString? ledColor;
    +        unsigned long ledOnPeriod;
    +        unsigned long ledOffPeriod;
    +    };
    +

    + Since: + 4.0 +

    +

    Remark : + Some members of notification could have no effect depending on the device. +

    +
    +

    Dictionary members

    +
    +
    DOMString? ledColor
    +
    +
    + Sets the notification LED indicator color property. +The color is a numerical RGB value(#rrggbb). The format of an RGB value in hexadecimal notation is a "#" immediately followed +by exactly six hexadecimal characters(0-9, A-F). The color format is case-insensitive. +
    +
    +

    +The LED indicator color will show that it's a close approximation. +LED will only light on when the screen is off. To turn the LED off, set "#000000" or null to ledColor. +This method has effects when the device has notification LED. +

    +
    +

    + Since: + 4.0

    - -
  56. -DOMString title
    - The title to display in a notification. +
  57. +
    unsigned long ledOnPeriod
    +
    +
    + The milliseconds for which the light is on. +The light continuously toggles on (ledOnPeriod) and off (ledOffPeriod). +By default, this attribute is set to 0

    Since: - 2.3.1 + 4.0

    - -
  58. -DOMString content [nullable]
    - The content to display in a notification. +
  59. +
    unsigned long ledOffPeriod
    +
    +
    + The milliseconds for which the light is off. +By default, this attribute is set to 0.

    Since: - 2.3.1 + 4.0

    - - -
    + +
    -
    -

    2.4. StatusNotificationInit

    -
    - The properties of StatusNotification, to pass a constructor. -
    -
        dictionary StatusNotificationInit {
    -        DOMString? content;
    -        DOMString? iconPath;
    -        DOMString? soundPath;
    -        boolean? vibration;
    -        ApplicationControl? appControl;
    -        ApplicationId? appId;
    -        NotificationProgressType? progressType;
    -        unsigned long? progressValue;
    -        long? number;
    -        DOMString? subIconPath;
    -        NotificationDetailInfo[]? detailInfo;
    -        DOMString? ledColor;
    -        unsigned long ledOnPeriod;
    -        unsigned long ledOffPeriod;
    -        DOMString? backgroundImagePath;
    -        DOMString[]? thumbnails;
    -    };
    -

    - Since: - 2.3.1 -

    -
    -

    2.5. StatusNotification

    +
    +

    2.12. StatusNotification

    The StatusNotification interface represents a status notification and offers additional attributes to represent a notification displayed in the notification tray.
    -
       [Constructor(StatusNotificationType statusType, DOMString title, optional StatusNotificationInit? notificationInitDict)]
    -
    +

    Deprecated. + Deprecated since 4.0. Use UserNotification instead. +

    +
        [Constructor(StatusNotificationType statusType, DOMString title, optional StatusNotificationInit? notificationInitDict)]
     
         interface StatusNotification : Notification {
     
    @@ -893,7 +1829,9 @@ try {
     All notifications must have a title attribute.
               

    - +

    Warning: + Some members of notification could have no effect depending on the device. +

    Constructors

    StatusNotification(StatusNotificationType statusType, DOMString title, optional StatusNotificationInit? notificationInitDict);
    @@ -964,29 +1902,28 @@ This method has effects when the device has notification LED. 2.3.1

    -

    Code example:

    -try
    -{
    +

    Code example:

     try
    + {
        var notificationDict =
        {
    -      content: "This is a simple notification.",
    -      iconPath: "images/image1.jpg",
    -      soundPath: "music/Over the horizon.mp3",
    -      vibration: true,
    -      ledColor: "#FFFF00",
    -      ledOnPeriod: 1000,
    -      ledOffPeriod: 500
    +     content: "This is a simple notification.",
    +     iconPath: "images/image1.jpg",
    +     soundPath: "music/Over the horizon.mp3",
    +     vibration: true,
    +     ledColor: "#FFFF00",
    +     ledOnPeriod: 1000,
    +     ledOffPeriod: 500
        };
     
        var notification = new tizen.StatusNotification("SIMPLE", "Simple notification", notificationDict);
     
        tizen.notification.post(notification);
    -}
    -catch (err)
    -{
    + }
    + catch (err)
    + {
        console.log(err.name + ": " + err.message);
    -}
    -
    + } +
  60. @@ -1068,30 +2005,29 @@ The maximum number of thumbnail path elements in the array is 4. 2.3.1

    -

    Code example:

    -try
    -{
    +

    Code example:

     try
    + {
        /* Gets the current application information with tizen.application.getAppInfo */
        var myappInfo = tizen.application.getAppInfo();
     
        var notificationDict =
        {
    -      content: "This is a simple notification.",
    -      iconPath: "images/image1.jpg",
    -      soundPath: "music/Over the horizon.mp3",
    -      vibration: true,
    -      appId: myappInfo.id
    +     content: "This is a simple notification.",
    +     iconPath: "images/image1.jpg",
    +     soundPath: "music/Over the horizon.mp3",
    +     vibration: true,
    +     appId: myappInfo.id
        };
     
        var notification = new tizen.StatusNotification("SIMPLE", "Simple notification", notificationDict);
     
        tizen.notification.post(notification);
    -}
    -catch (err)
    -{
    + }
    + catch (err)
    + {
        console.log(err.name + ": " + err.message);
    -}
    -
    + } +
  61. @@ -1127,20 +2063,19 @@ Range of progressValue: percent (0 to 100). 2.3.1

    -

    Code example:

    -try
    -{
    +

    Code example:

     try
    + {
        var appControl = new tizen.ApplicationControl("http://tizen.org/appcontrol/operation/create_content",
                                                      null, "image/jpg", null);
     
        var notificationDict =
        {
    -      content: "This is a progress notification.",
    -      iconPath: "images/image2.jpg",
    -      soundPath: "music/Over the horizon.mp3",
    -      vibration: true,
    -      appControl: appControl,
    -      progressValue: 20
    +     content: "This is a progress notification.",
    +     iconPath: "images/image2.jpg",
    +     soundPath: "music/Over the horizon.mp3",
    +     vibration: true,
    +     appControl: appControl,
    +     progressValue: 20
        };
        /* Constructs the progress notification */
        var notification = new tizen.StatusNotification("PROGRESS", "Progress notification", notificationDict);
    @@ -1150,19 +2085,319 @@ try
        /* Updates the progress value of the notification */
        notification.progressValue = 59;
        tizen.notification.update(notification);
    -}
    -catch (err)
    -{
    + }
    + catch (err)
    + {
        console.log(err.name + ": " + err.message);
    -}
    -
    + } +
    +
    +
  62. + +
    +
    +
    +

    2.13. UserNotification

    +
    + The UserNotification interface represents a notification and offers additional attributes to represent a notification displayed in the notification tray. +
    +
        [Constructor(UserNotificationType userType, DOMString title, optional UserNotificationInit? notificationGropedInitDict)]
    +    interface UserNotification : Notification {
    +
    +    readonly attribute UserNotificationType userType;
    +
    +    attribute NotificationTextContentInfo? textContents;
    +
    +    attribute NotificationImageInfo? images;
    +
    +    attribute NotificationThumbnailInfo? thumbnails;
    +
    +    attribute NotificationActionInfo? actions;
    +
    +    attribute NotificationGroupContentInfo? groupContents;
    +
    +    attribute NotificationLedInfo? leds;
    +    };
    +

    + Since: + 4.0 +

    +
    +

    +All notifications must have a title attribute. +

    +
    +

    Warning: + Some members of notification could have no effect depending on the device. +

    +
    +

    Constructors

    +
    UserNotification(UserNotificationType userType, DOMString title, optional UserNotificationInit? notificationGropedInitDict);
    +
    +
    +

    Attributes

    +
      +
    • + readonly +UserNotificationType userType
      + The type of notification. +
      +

      + Since: + 4.0 +

      +
    • +
    • +NotificationTextContentInfo textContents [nullable]
      + Defines content-related settings of a notification. +
      +
      +

      +If this is null, all property values of a NotificationTextContentInfo dictionary are ignored. +

      +
      +

      + Since: + 4.0 +

      +
      +

      Code example:

       try
      + {
      +   var notificationGroupDict =
      +   {
      +     content: "This is a progress notification.",
      +     textContents:
      +     {
      +       progressValue: 20
      +     }
      +   };
      +
      +   /* Constructs the progress notification */
      +   var notification = new tizen.UserNotification("PROGRESS", "Progress notification", notificationGroupDict);
      +   /* Posts the notification */
      +   tizen.notification.post(notification);
      +
      +   /* Updates the progress value of the notification */
      +   notification.textContents.progressValue = 59;
      +   tizen.notification.update(notification);
      + }
      + catch (err)
      + {
      +   console.log(err.name + ": " + err.message);
      + }
      + 
      +
      +
    • +
    • +NotificationImageInfo images [nullable]
      + Defines additional image-related settings of a notification. +
      +
      +

      +If this is null, all property values of a NotificationImageInfo dictionary are ignored. +

      +
      +

      + Since: + 4.0 +

      +
      +

      Code example:

       try
      + {
      +   var notificationGroupDict =
      +   {
      +     content: "This is a SIMPLE notification with icon.",
      +     images:
      +     {
      +       iconPath: "images/image2.jpg"
      +     }
      +   };
      +
      +   /* Constructs the simple notification */
      +   var notification = new tizen.UserNotification("SIMPLE", "Simple notification", notificationGroupDict);
      +   /* Posts the notification */
      +   tizen.notification.post(notification);
      + }
      + catch (err)
      + {
      +   console.log(err.name + ": " + err.message);
      + }
      + 
      +
      +
    • +
    • +NotificationThumbnailInfo thumbnails [nullable]
      + Defines additional thumbnails-related settings of a notification. +
      +
      +

      +If this is null, all property values of a NotificationThumbnailInfo dictionary are ignored. +

      +
      +

      + Since: + 4.0 +

      +
      +

      Code example:

       try
      + {
      +   var notificationGroupDict =
      +   {
      +     content: "This is an ongoing notification with tumbnail and icon",
      +     images:
      +     {
      +       iconPath: "images/image2.jpg"
      +     },
      +     thumbnails:
      +     {
      +       thumbnailIconPath: "images/thumbnail.jpg"
      +     }
      +   };
      +
      +   /* Constructs the ongoing notification */
      +   var notification = new tizen.UserNotification("ONGOING", "Ongoing notification", notificationGroupDict);
      +   /* Posts the notification */
      +   tizen.notification.post(notification);
      + }
      + catch (err)
      + {
      +   console.log(err.name + ": " + err.message);
      + }
      + 
      +
      +
    • +
    • +NotificationActionInfo actions [nullable]
      + Defines additional actions-related settings of a notification. +
      +
      +

      +If this is null, all property values of a NotificationActionInfo dictionary are ignored. +

      +
      +

      + Since: + 4.0 +

      +
      +

      Code example:

       try
      + {
      +   var appControl = new tizen.ApplicationControl("http://tizen.org/appcontrol/operation/create_content",
      +                                                 null, "image/jpg", null);
      +
      +   var notificationGroupDict =
      +   {
      +     content: "This is a progress notification with sound and appcontrol",
      +     images:
      +     {
      +       iconPath: "images/image2.jpg"
      +     },
      +     actions:
      +     {
      +       soundPath: "music/Over the horizon.mp3",
      +       vibration: true,
      +       appControl: appControl
      +     }
      +   };
      +
      +   /* Constructs the progress notification */
      +   var notification = new tizen.UserNotification("PROGRESS", "Progress notification", notificationGroupDict);
      +   /* Posts the notification */
      +   tizen.notification.post(notification);
      + }
      + catch (err)
      + {
      +   console.log(err.name + ": " + err.message);
      + }
      + 
      +
      +
    • +
    • +NotificationGroupContentInfo groupContents [nullable]
      + Defines additional group-content-related settings of a notification. +
      +
      +

      +If this is null, all property values of a NotificationGroupContentInfo dictionary are ignored. +

      +
      +

      + Since: + 4.0 +

      +
      +

      Code example:

       try
      + {
      +   var notificationGroupDict =
      +   {
      +     content: "This is a progress notification with groupContents",
      +     groupContents:
      +     {
      +       groupTitle: "A group title",
      +       groupContent: "Some group content"
      +     },
      +     images:
      +     {
      +       iconPath: "images/image2.jpg"
      +     }
      +   };
      +
      +   /* Constructs the progress notification with groupContents */
      +   var notification = new tizen.UserNotification("PROGRESS", "Progress notification", notificationGroupDict);
      +   /* Posts the notification */
      +   tizen.notification.post(notification);
      + }
      + catch (err)
      + {
      +   console.log(err.name + ": " + err.message);
      + }
      + 
      +
      +
    • +
    • +NotificationLedInfo leds [nullable]
      + Defines additional LED-related settings of a notification. +
      +
      +

      +If this is null, all property values of a NotificationLedInfo dictionary are ignored. +

      +
      +

      + Since: + 4.0 +

      +
      +

      Code example:

       try
      + {
      +   var notificationGroupDict =
      +   {
      +     content: "This is a SIMPLE notification with blinking LED",
      +     leds:
      +     {
      +       ledColor: "#FFFF00",
      +       ledOnPeriod: 1000,
      +       ledOffPeriod: 500
      +     }
      +   };
      +
      +   /* Constructs the simple notification */
      +   var notification = new tizen.UserNotification("SIMPLE", "Simple notification", notificationGroupDict);
      +   /* Posts the notification */
      +   tizen.notification.post(notification);
      + }
      + catch (err)
      + {
      +   console.log(err.name + ": " + err.message);
      + }
      + 
    -

    2.6. NotificationDetailInfo

    +

    2.14. NotificationDetailInfo

    The NotificationDetailInfo object that contains the detail information of the notification.
    @@ -1177,9 +2412,8 @@ catch (err) 2.3.1

    -

    Code example:

    -var detailInfo1 = new tizen.NotificationDetailInfo('Missed Call from James', 'Feb 11 2013');
    -notification.detailInfo = [detailInfo1];
    +

    Code example:

     var detailInfo1 = new tizen.NotificationDetailInfo("Missed Call from James", "Feb 11 2013");
    + notification.detailInfo = [detailInfo1];
     
    @@ -1217,7 +2451,21 @@ By default, this attribute is set to null.
    -

    3. Full WebIDL

    +

    3. Related Feature

    +
    + You can check if this API is supported with tizen.systeminfo.getCapability() and decide enable/disable codes that need this API. +
    +

    +

    +If an application uses playLEDCustomEffect() or stopLEDCustomEffect(), declare the following feature requirements in the config file to guarantee the running of this application on a device which has a led: +

    +

    +
  63. http://tizen.org/feature/led
  64. +
    +

    + For more information, see Application Filtering. +
    +

    4. Full WebIDL

    module Notification {
     
         typedef DOMString NotificationId;
    @@ -1226,8 +2474,11 @@ By default, this attribute is set to null.
     
         enum StatusNotificationType { "SIMPLE", "THUMBNAIL", "ONGOING", "PROGRESS" };
     
    +    enum UserNotificationType { "SIMPLE", "THUMBNAIL", "ONGOING", "PROGRESS" };
    +
         enum NotificationProgressType { "PERCENTAGE",  "BYTE" };
     
    +    enum LEDCustomFlags {"LED_CUSTOM_DUTY_ON", "LED_CUSTOM_DEFAULT"};
     
         [NoInterfaceObject] interface NotificationObject {
             readonly attribute NotificationManager notification;
    @@ -1244,19 +2495,22 @@ By default, this attribute is set to null.
     
         void removeAll() raises(WebAPIException);
     
    -    Notification get(NotificationId id) raises(WebAPIException);
    +    Notification getNotification(NotificationId id) raises(WebAPIException);
    +
    +    Notification[] getAllNotifications() raises(WebAPIException);
     
    -    Notification[] getAll() raises(WebAPIException);
    +    void playLEDCustomEffect(long timeOn, long timeOff, DOMString color, LEDCustomFlags[] flags) raises(WebAPIException);
    +
    +    void stopLEDCustomEffect() raises(WebAPIException);
     
         void saveNotificationAsTemplate(DOMString name, Notification notification) raises(WebAPIException);
     
    -    Notification createNotificationFromTemplate(DOMString name) raises(WebAPIException);
    +    UserNotification createNotificationFromTemplate(DOMString name) raises(WebAPIException);
         };
     
     
         [NoInterfaceObject] interface Notification {
     
    -
         readonly attribute NotificationId id;
     
         readonly attribute NotificationType type;
    @@ -1266,31 +2520,61 @@ By default, this attribute is set to null.
         attribute DOMString title;
     
         attribute DOMString? content;
    -
         };
     
    -
    -    dictionary StatusNotificationInit {
    +    dictionary UserNotificationInit {
             DOMString? content;
    +        NotificationTextContentInfo? textContents;
    +        NotificationImageInfo? images;
    +        NotificationThumbnailInfo? thumbnails;
    +        NotificationActionInfo? actions;
    +        NotificationGroupContentInfo? groupContents;
    +        NotificationLedInfo? leds;
    +    };
    +    dictionary NotificationTextContentInfo {
    +        NotificationProgressType? progressType;
    +        unsigned long? progressValue;
    +        long? eventsNumber;
    +        NotificationDetailInfo[]? detailInfo;
    +        DOMString[]? buttonsTexts;
    +        DOMString? contentForOff;
    +    };
    +
    +    dictionary NotificationImageInfo {
             DOMString? iconPath;
    +        DOMString? subIconPath;
    +        DOMString? indicatorIconPath;
    +        DOMString? lockScreenIconPath;
    +        DOMString[]? buttonIconPaths;
    +        DOMString? backgroundImagePath;
    +    };
    +
    +    dictionary NotificationThumbnailInfo {
    +        DOMString? lockScreenThumbnailIconPath;
    +        DOMString? thumbnailIconPath;
    +        DOMString[]? thumbnails;
    +    };
    +
    +    dictionary NotificationActionInfo {
             DOMString? soundPath;
             boolean? vibration;
             ApplicationControl? appControl;
             ApplicationId? appId;
    -        NotificationProgressType? progressType;
    -        unsigned long? progressValue;
    -        long? number;
    -        DOMString? subIconPath;
    -        NotificationDetailInfo[]? detailInfo;
    +    };
    +
    +    dictionary NotificationGroupContentInfo {
    +        DOMString? groupTitle;
    +        DOMString? groupContent;
    +        DOMString? groupContentForOff;
    +    };
    +    dictionary NotificationLedInfo {
             DOMString? ledColor;
             unsigned long ledOnPeriod;
             unsigned long ledOffPeriod;
    -        DOMString? backgroundImagePath;
    -        DOMString[]? thumbnails;
         };
     
    -   [Constructor(StatusNotificationType statusType, DOMString title, optional StatusNotificationInit? notificationInitDict)]
     
    +    [Constructor(StatusNotificationType statusType, DOMString title, optional StatusNotificationInit? notificationInitDict)]
     
         interface StatusNotification : Notification {
     
    @@ -1327,6 +2611,24 @@ By default, this attribute is set to null.
         attribute unsigned long? progressValue;
         };
     
    +    [Constructor(UserNotificationType userType, DOMString title, optional UserNotificationInit? notificationGropedInitDict)]
    +    interface UserNotification : Notification {
    +
    +    readonly attribute UserNotificationType userType;
    +
    +    attribute NotificationTextContentInfo? textContents;
    +
    +    attribute NotificationImageInfo? images;
    +
    +    attribute NotificationThumbnailInfo? thumbnails;
    +
    +    attribute NotificationActionInfo? actions;
    +
    +    attribute NotificationGroupContentInfo? groupContents;
    +
    +    attribute NotificationLedInfo? leds;
    +    };
    +
         [Constructor(DOMString mainText, optional DOMString? subText)]
         interface NotificationDetailInfo {
         attribute DOMString mainText;