Im trying to alert something when my app is open and a mifare 1k card is sweep at the back of my note 1.
So this is my code:
var nfc = require('ti.nfc'); var nfcAdapter = null;
nfcAdapter = nfc.createNfcAdapter({ onNdefDiscovered: handleDiscovery, onTagDiscovered: handleDiscovery, onTechDiscovered: handleDiscovery });
if(!nfcAdapter.isEnabled()) { alert('Not nfc enabled'); return; }
function handleDiscovery(data) { alert('hey'); }
$.index.open();
Nothing happens everytime I sweep a card to my phone. Can someone help me?