javascripthtmltizensamsung-smart-tv

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.

Here's the code:

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

Is there a solution?


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: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. 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.

    <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.