ionic-frameworkphonegap-pluginscapacitor

Using Phonegap NFC Plugin in Ionic to scan RFID tags


I am using Phonegap Plugin in ionic for scanning RFID tags and tried creating a build for IOS. I am using nfc.scanNdef() function as described here https://github.com/chariotsolutions/phonegap-nfc for IOS. The code looks like this:

  async ngOnInit(): Promise<void> {
    try {
        let tag = await this.nfc.scanNdef();
        console.log(JSON.stringify(tag));
     } catch (err) {
         console.log('Error reading tag ngoninit', err);
     }
  }

The issue is that the scanning session starts on my iPhone but it does not scan the tag at all. Can anyone please tell me what am I doing wrong?

Using IOS version 15.5 Device iphone 7


Solution

  • Use scanTag instead of using scanNdef and try it again. Please see https://github.com/chariotsolutions/phonegap-nfc