Languages

Menu
Sites
Language
Reading NFC tags not supported with Gear S2

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);
}

Responses

1 Replies
Shinjae Lee

Hi,

For my understanding, an emulator is a generic one. In case of a real device, it depends on HW spec.

Plz check below URL for the feature. (nfc tag is not supported in S2)

http://developer.samsung.com/gear/develop/device-compatibility

Hope this helps.