chariotsolutions / phonegap-nfc

PhoneGap NFC Plugin
MIT License
706 stars 555 forks source link

beginSession fails in iOS using ionic-native-nfc #381

Closed rayron closed 4 years ago

rayron commented 4 years ago

I have a project built in ionic 1 and angular which works on both android and ios fine. I have since moved this over to ionic 4 using the ionic native wrapper. Android works fine but ios is reporting an error. "ERROR: Method 'channel:' not defined in Plugin 'NfcPlugin'. This maybe due to the ionic native wrapper as in the docs it does not state ios as a platform. Does anyone know of a way to access the beginSession and all nfc methods in ionic 4 without using the ionic-native wrapper? This project is becoming a priority.

don commented 4 years ago

Fixed in #399

beginSession is deprecated. Use scanNdef instead since it returns a Promise. The Ionic wrapper isn't updated yet, so use(<any>window).nfc.scanNdef() until it's updated.