Search code examples
ionic-frameworkcordova-pluginsnfcios12ndef

How to check if NFC available for iOS using ionic?


I wanted to know is it possible to check using ionic if iOS device has NFC functionality. I can use "PhoneGap NFC Plugin" but it only has nfc.beginSession() function which isn't what I need because it opens NFC reading window for iOS but I just want to check if available without opening any windows. I know that you can call in swift NFCNDEFReaderSession.readingAvailable() but is there a plugin which offers what I need?


Solution

  • The enabled() method of the phonegap-nfc plugin seems to do exactly what you want on iOS: it internally calls NFCNDEFReaderSession.readingAvailable().