我正在尝试在基于 Javascript 的 Tizen TV 应用程序中实现一个按钮。单击按钮后,它应该打开另一个应用程序的 App Store 页面。
我指的是这些文件: https://developer.tizen.org/sites/default/files/documentation/tizen2.3_deep_linking_guide_v1.0.pdf https://developer.tizen.org/ko/community/tip-tech/linking-your-application?langredirect=1 深度链接到 Samsung TV (Tizen) 上的 YouTube 内容
我在config.xml中添加了以下权限
<tizen:privilege name="http://tizen.org/privilege/application.launch"/>
<tizen:privilege name="http://tizen.org/privilege/appmanager.launch"/>
window.tizen 返回以下对象
{"BundleValueType":{"STRING":"STRING","STRING_ARRAY":"STRING_ARRAY","BYTES":"BYTES","BYTES_ARRAY":"BYTES_ARRAY"},"cordova":{"file":{},"globalization":{}},"tvinputdevice":{},"systeminfo":{},"account":{},"alarm":{"PERIOD_MINUTE":60,"PERIOD_HOUR":3600,"PERIOD_DAY":86400,"PERIOD_WEEK":604800},"application":{},"archive":{},"filesystem":{"maxNameLength":255,"maxPathLength":4096},"content":{},"datacontrol":{},"download":{},"exif":{},"iotcon":{"deviceName":""},"keymanager":{},"mediacontroller":{},"mediakey":{},"messageport":{},"package":{},"push":{},"time":{},"tvaudiocontrol":{},"tvchannel":{},"tvdisplaycontrol":{},"tvinfo":{},"tvwindow":{},"voicecontrol":{},"websetting":{}}
这里window.tizen.application是一个空对象
但是我们需要
window.tizen.application.launch
或 window.tizen.applciation.launchAppControl
来实现此功能(根据上述文档)
有人知道为什么它不可用吗?
您需要
application.launch
特权。
config.xml
<tizen:privilege name="http://tizen.org/privilege/application.launch"/>
一旦设置了权限,就可以使用
window.tizen.launchAppControl()
。
const appIdFromSellerOffice = '0343289392' // You should know this and it also writes in the URL of the seller office
const appControl = new window.tizen.ApplicationControl(
'http://tizen.org/appcontrol/operation/view',
null,
null,
null,
[
new window.tizen.ApplicationControlData('Sub_Menu', ['detail']),
new window.tizen.ApplicationControlData('widget_id', [appIdFromSellerOffice]),
new window.tizen.ApplicationControlData('caller_id', [appIdFromSellerOffice]),
],
)
window.tizen.application.launchAppControl(appControl, 'com.samsung.tv.store', null, onError, null)