Hi,
We are developing a standalone tizen wearable web app for Samsung Gear S2.
We need to incorporate Host Card Emulation functionality in it.
We have followed the link
https://developer.tizen.org/development/tutorials/web-application/tizen-features/communication/nfc
https://developer.tizen.org/development/guides/web-application/tizen-features/communication/nfc
When we deployed the application to Gear S2, the control does not come to addHCEEventListener() function.
JS code
( function () { var hceListenerId = 0; var adapter = tizen.nfc.getDefaultAdapter(); try { adapter.cardEmulationMode = "ALWAYS_ON"; } catch(e) { console.log(e.name + ": " + e.message); } try { hceListenerId = adapter.addHCEEventListener(function(event_data) { if (event_data.eventType =="ACTIVATED") { window.alert("HCE activated"); } else if (event_data.eventType =="DEACTIVATED") { window.alert("HCE deactivated"); } else if (event_data.eventType =="APDU_RECEIVED") { window.alert("APDU received"); } }); } catch (error) { console.log("AddHCE Exception - " + error.name + ":" + error.message); } } () );
config.xml
<?xml version="1.0" encoding="UTF-8"?> <widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets" id="http://yourdomain/NFCCardPoc" version="1.0.0" viewmodes="maximized"> <tizen:app-control> <tizen:src name="index.html"/> <tizen:operation name="http://tizen.org/appcontrol/operation/nfc/transaction"/> </tizen:app-control> <tizen:app-control> <tizen:src name="index.html"/> <tizen:operation name="http://tizen.org/appcontrol/operation/nfc/host_apdu_service"/> </tizen:app-control> <tizen:application id="ehMGP0bX15.NFCCardPoc" package="ehMGP0bX15" required_version="2.3"/> <content src="index.html"/> <feature name="http://tizen.org/feature/screen.size.normal"/> <feature name="http://tizen.org/feature/network.nfc"/> <feature name="http://tizen.org/feature/network.nfc.card_emulation"/> <feature name="http://tizen.org/feature/network.nfc.card_emulation.hce"/> <icon src="icon.png"/> <tizen:metadata key="http://tizen.org/metadata/nfc_cardemulation" value="wallet.xml"/> <name>NFCCardPoc</name> <tizen:privilege name="http://tizen.org/privilege/application.launch"/> <tizen:privilege name="http://tizen.org/privilege/nfc.common"/> <tizen:privilege name="http://tizen.org/privilege/nfc.admin"/> <tizen:privilege name="http://tizen.org/privilege/nfc.cardemulation"/> <tizen:profile name="wearable"/> <tizen:setting background-support="disable" encryption="disable" hwkey-event="enable"/> </widget>
Is wallet.xml needed for this. We have given this but we do not know the significance of this. Can anybody help on this?
Is HCE supported in wearable web?
Or is there any steps that we missed.
Thanks in Advance