Languages

Menu
Sites
Language
[Web Wearable] Tizen Wear app not launching from Notification

Hi,

Can someone help me out of this issue. As I'm new to Tizen Wear web application development, and in this I'm trying to create a status notification from the app. I'm able to create the notification. Then when the user open the notification tray and trying to click on Open App then the Tizen wear app is not launching the app. And then when I try to open the app explicitely I could observe that the app loaded with the new page(home.html) which is the notification tried to launch.

Here is my code:

                 var appInfo = tizen.application.getAppInfo();

        var appCtrl = new tizen.ApplicationControl(

                'tizen.org/appcontrol/operation/create_content');        

        var notificationDict = {

            content : 'This is a simple notification.',

            iconPath : 'images/icon.png',

             soundPath: 'sounds/Beep-Once.wav',

            vibration : true,

            appControl : appCtrl,

            appId : appInfo.id

        };

        var notification = new tizen.StatusNotification('SIMPLE',

                'Simple notification', notificationDict);

        tizen.notification.post(notification);

In Congif.xml:

    <tizen:app-control>

        <tizen:src name="home.html"/>

        <tizen:operation name="tizen.org/appcontrol/operation/create_content"/>

    </tizen:app-control>

Can anyone help me out I'm using Samsung Gear S3 - 2.3.2.3 version.

Edited by: Nagaraju Bhusani on 13 Sep, 2017

Responses

8 Replies
André Reus

hi, simply put the appid which you want to launch in the notificationDict at the appId parameter just like this, 

var appid = 'com.samsung.message';
       var notification,
       notificationDict;

   try {
       // Sets notification dictionary.
       notificationDict = {
           content: "content",
           iconPath: "../icon.png",
           vibration : true,
           ledColor : "#FFFF00",
           ledOnPeriod : 1000,
           ledOffPeriod : 500,
           appId: appid
       };
       // Creates notification object.
       notification = new tizen.StatusNotification("SIMPLE", "title", notificationDict);

       // Posts notification.
       tizen.notification.post(notification);
   } catch (err) {
       console.log(err.name + ": " + err.message);
   }

In my case, i put appid of message app of gear. You can put any appid which is installed in the device. 

And in the config.xml add these two privileges, 

<tizen:privilege name="http://tizen.org/privilege/notification"/>
<tizen:privilege name="http://tizen.org/privilege/application.launch"/>

 

Nagaraju Bhusani

Hi Andre,

Thanks for the reply.

I hope you saw the post and my code as well, it has the appId attribute for the notification. Still no luck and I'm testing with Gear S3 device with 2.3.2.3 version.

 

 

André Reus

Have you noticed i used the app id of message app ?

var appid = 'com.samsung.message';

After clicking on the notification my app is launching Message app of Gear. You should use the appid you want to launch. 

Nagaraju Bhusani

Thanks for reply.

I'm able to open this app "com.samsung.message" but I want to open my own app "KD2UVvdY7E" which is my package. But when I'm using this I'm not able open it at all. Any suggestion.

Thanks

 

p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Eco Sans Mono'; color: #3933ff}

 

 

p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Eco Sans Mono'; color: #3933ff}
André Reus

Your app is not launching because "KD2UVvdY7E"  this is not your full appid. This should be "KD2UVvdY7E".SomeThing  ...please check config.xml to be sure about the appid. 

-Thanks 

Nagaraju Bhusani

Hi Andre,

Even I tried with that too "KD2UVvdY7E.HelloMessageProvider" still it is not working. But I can luach that "com.samsung.message" app not my app.

-Thanks

 

André Reus

In my case, my app is launching using my app id . And please use try-catch block to get the exeption message. 

GEUNSOO KIM

use try-catch block as André Reus did on his sample code to check if there is any exception or not.

If there is, you can fix it with the exception info.

good luck.