Dear ladies and gentlemen,
could anybody tell my why it is not possible to read NFC tags with the Gear S2. I got the following error: NotSupportedError: Tag is not supported
But this only appears on the real device. The emulator has no problem with it and it works.
Here the code:
function init(){ var nfcSwitchAppControl = new tizen.ApplicationControl( "http://tizen.org/appcontrol/operation/setting/nfc", null, null, null, [ new tizen.ApplicationControlData("type", "nfc") ]); var adapter = tizen.nfc.getDefaultAdapter(); function launchSuccess() { console.log("NFC Settings application has successfully launched."); } function launchError(error) { alert("An error occurred: " + error.name + ". Please enable NFC through the Settings application."); } var serviceReply = { /* onsuccess is called when the launched application reports success */ onsuccess : function(data) { if (adapter.powered) { console.log("NFC is successfully turned on."); } }, /* * onfailure is called when the launched application reports failure of * the requested operation */ onfailure : function() { alert("NFC Settings application reported failure."); } } var setTagDetect = { /* When an NFC tag is detected */ onattach : function(nfcTag) { console.log("NFC Tag detected. Its type is: " + nfcTag.type); console.log(nfcTag); }, /* When an NFC tag becomes unavailable */ ondetach : function() { console.log("NFC Tag unavailable"); } } adapter.setTagListener(setTagDetect); }