Hi, I have a weird problem, and I can't solve it..
When I open my app, and read a NFC tag in my mobile, its sounds but not execute my callback function. Next, I press the "Recents apps" button in my Nexus 5, and reopen again my app (resume). Now, when I read the same NFC tag again, it works perfectly.
This is my code:
document.addEventListener('deviceready', onDeviceReady, false);
function onDeviceReady() {
nfc.addTagDiscoveredListener(onNfc, winNfc, failNfc);
...
}
function onNfc(nfcEvent) { // I only want to read the tag Identifier
alert('onNFC');
var tag = nfcEvent.tag;
var tagId = nfc.bytesToHexString(tag.id);
alert(tagId);
...
}
function winNfc() {
console.log("Listening for NFC Tags");
}
function failNfc(error) {
alert("Error de NFC: " + error);
}
I use build.phonegap.com to compile, and have this line in my config.xml:
Hi, I have a weird problem, and I can't solve it..
When I open my app, and read a NFC tag in my mobile, its sounds but not execute my callback function. Next, I press the "Recents apps" button in my Nexus 5, and reopen again my app (resume). Now, when I read the same NFC tag again, it works perfectly.
This is my code:
I use build.phonegap.com to compile, and have this line in my config.xml:
Phonegap version: 3.5.0
What I am doing wrong ??
THANKS in advance.
Raúl.