简体   繁体   English

在三星智能电视上显示警报

[英]Showing Alert on samsung smart TV

I am working on a tizen application on Samsung smart TV, when I create an alert with window.alert() it works on emulator but on TV. 我正在使用三星智能电视上的一个简单应用程序,当我使用window.alert()创建警报时,它可以在模拟器上运行,但可以在电视上运行。

Here's the code: 这是代码:

mac = webapis.network.getMac();
console.log(mac);
window.alert(mac);

Is there a solution? 有解决方案吗?

As you using Tizen Network API add internet access privilege for your Tizen application in the config.xml file.Internet Privilege allows the application to access the Internet. 当您使用Tizen Network API时,请在config.xml文件中为您的Tizen应用程序添加Internet访问权限.Internet Privilege允许该应用程序访问Internet。

<tizen:privilege name="tizen.org/privilege/internet"/>
<tizen:privilege name="http://developer.samsung.com/privilege/network.public"/>

Also defining external access Policy may be required to access network. 还可能需要定义外部访问策略才能访问网络。 According to the W3C Access Requests Policy (WARP), you cannot access external network resources by default. 根据W3C访问请求策略(WARP),默认情况下您不能访问外部网络资源。 If you require access to an external network resource, you must request network resource permissions for the Web application using the Policy in the config.xml file. 如果需要访问外部网络资源,则必须使用config.xml文件中的“策略”为Web应用程序请求网络资源权限。

<access origin="*" subdomains="true"/>

Now your application should be able to access MAC address from the real devices as like as emulators and you should be able to alert MAC adress from TV devices. 现在,您的应用程序应该能够像模拟器一样从真实设备访问MAC地址,并且您应该能够从电视设备警告MAC地址。

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

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