简体   繁体   English

如何从我自己的Tizen应用程序启动Gear 2通知应用程序

[英]how to launch Gear 2 notifications app from my own Tizen app

I would like to add a shortcut to default Samsung notifications app on my Tizen app. 我想在Tizen应用程序上为默认的三星通知应用程序添加快捷方式。

I've found that the name of the app (which I want to launch) is : com.samsung.wnotification2 我发现该应用程序(我要启动)的名称是:com.samsung.wnotification2

I used the following code to launch it: 我使用以下代码启动它:

tizen.application.launch("com.samsung.wnotification2",onListInstalledApps);

But it doesn't work. 但这是行不通的。

Here arethe privileges I used : privileges I installed: 这是我使用的特权:我安装的特权:

<tizen:privilege name="http://tizen.org/privilege/appmanager.launch"/>
<tizen:privilege name="http://tizen.org/privilege/appmanager.setting"/>
<tizen:privilege name="http://tizen.org/privilege/application.info"/>

What am I missing ? 我想念什么?

Are you sure that this is correct ID of application? 您确定这是正确的应用程序ID? Add: 加:

tizen.application.launch("com.samsung.wnotification2",onListInstalledApps,function(e){console.log(e);});

you will get: 你会得到:

  • NotFoundError - If the application is not found with the specified ID. NotFoundError-如果找不到具有指定ID的应用程序。
  • InvalidValuesError - If any of the input parameters contain an invalid value. InvalidValuesError-如果任何输入参数包含无效值。
  • UnknownError - If any other error occurs. UnknownError-如果发生任何其他错误。

your permissions are ok - otherwise you would get SecurityError 您的权限还可以-否则您将收到SecurityError

Please use 请用

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

Instead of 代替

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

Also it's better to provide a custom (empty) success function, not onListInstalledApps that is most probably has a different purpose. 另外,最好提供一个自定义(空)成功函数,而不是提供可能具有不同用途的onListInstalledApps。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM