Closed olivelihui closed 9 years ago
@olivelihui I'm assuming you're running on Android? addNdefListener
will only trigger a callback if you scan a NFC tag with an NDEF message. If your NFC tag is not NDEF or hasn't been formatted you'll need to use addTagDiscoveredListener
or addNdefFormatableListener
.
Also, if you have a phone with the Broadcom NFC chipset it won't be able to read Mifare Classic NFC tags even if they are NDEF formatted.
Try using another app like NFC TagInfo by NXP to determine what's on your NFC tags. You can use NFC TagWriter by NXP to format and write messages to tags.
Assuming you've fixed this by adding additional listeners. If not, reopen the issue.
nfc.addNdefListener( writeTag, function() { alert("Success."); }, function() { alert("Fail."); } );
function writeTag(nfcEvent) { alert("write message!"); }