Languages

Menu
Sites
Language
Notification contents not displaying in Tizen wearable webapp with angularJS.

I am developing tizen wearable webapp for gear s2, In that I want to display notification and my code is as follows:

$scope.noti= function(){
        try {
            var appControl = new tizen.ApplicationControl(
                             "http://tizen.org/appcontrol/operation/create_content",
                             null,"text/html",null);
            var notificationDict = {
                        content : "New Task Arrived.",
                        iconPath : "resources/images/TaskWatch.jpg",
                        vibration : true,
                        appControl : appControl
                 };
             
            var notification = new tizen.StatusNotification("SIMPLE", 
                        "Notification", notificationDict);                             
            tizen.notification.post(notification);             
       } catch (err) {
            console.log (err.name + ": " + err.message);
       }
    }

But the problem is that contents not displying in notification, But notification name is displaying properly.

Thanks in advance..

 

Responses

2 Replies
Iqbal Hossain

Hi~

You can use Get method of Tizen Web Notification API.

tizen.notification.getAll();

You can make a method for this task,

function showNotifications() {
        var notifications,
            i;

        notifications = tizen.notification.getAll();

        if (notifications.length === 0) {
            // If there is no notification, shows "No notification" message.
        } else {
            for (i = 0; i < notifications.length; i++) {
                      // bind each notifications[i] to your UI
            }
            
        }
    }

 

You can follow these resources:

1. https://developer.tizen.org/development/articles/notifications?langswitch=en&langredirect=1 (With Example Demo Code)

2. https://developer.tizen.org/ko/development/tutorials/web-application/tizen-features/application/notification?langredirect=1

 

-Thanks

Sandip Patil

By using getAll Notifications I am getting proper contents in console log but not displaying on notification itself. Code is as follows:

var notifications = tizen.notification.getAll();
            if( notifications.length > 0){
                    var myId = notifications[0].id;
                var myNotification = tizen.notification.get(myId);        
                console.log("myNotification.content::"+myNotification.content);

}

It is showing output on console as : myNotification.content:: New Task Arrived.

But not showing on notification itself. That means it is setting the notification contents properly but not displaying correctly.

And I already refered the following link:

https://developer.tizen.org/ko/development/tutorials/web-application/tizen-features/application/notification?langredirect=1

 

Please help me.

Thanks