Closed juliengloria closed 5 years ago
Separat the NFC beginSession
function enableNFC() { nfc.beginSession(); } When you init the NFC you will see one popOver on your iphone.
Later add your code -->
nfc.addNdefListener(() => { console.log('successfully attached ndef listener'); this.messages.push('successfully attached ndef listener'); this.cekNFC(); }, (err) => { console.log('error attaching ndef listener' + err); this.messages.push('error attaching ndef listener' + err); }).subscribe((event) => { console.log('received ndef message. the tag contains: ' + event); this.messages.push('received ndef message. the tag contains:' + event); });
nfc is GLOBAL so is not on THIS context....
declare let nfc : any; at top of constructor
Does your NFC tag contain an NDEF message? iOS only scans NDEF tags.
You could try this sample project https://github.com/don/phonegap-nfc-ios
Hi, I got the flyout "Ready to Scan" on my phone, but nothing is raised in my subscription.