chariotsolutions / phonegap-nfc

PhoneGap NFC Plugin
MIT License
712 stars 568 forks source link

Failed to initialize the NfcPlugin NFC_DISABLED - possible to re-init plugin? #344

Closed adrianhardy closed 5 years ago

adrianhardy commented 6 years ago

Hi,

Is it possible to reinitialise the plugin at runtime? If a user turns on NFC after the application has started, it'd be useful to be able to start the handlers, set up subscribes..

Thanks

don commented 5 years ago

If the user enables NFC, your app can add the handlers and everything should work. This is your apps responsibility rather than the plugins.

adrianhardy commented 5 years ago

Sorry, I think I've misunderstood. Take a look at: https://github.com/chariotsolutions/phonegap-nfc/blob/aa92afca3686dff038d71d2ecb270c62e07c4bcb/www/phonegap-nfc.js#L20

Because that callback is only triggered by deviceready, if the cordova.exec call fails (for whatever reason) then the plugin never has another opportunity to be initialised.

Or, are you saying that I can call handleNfcFromIntentFilter somehow from within the app?