chariotsolutions / phonegap-nfc

PhoneGap NFC Plugin
MIT License
706 stars 556 forks source link

Petition for the inclusion of a method such as registerNFCStateChangeHandler() #269

Closed fjms closed 7 years ago

fjms commented 7 years ago

To verify if nfc is enabled, I resort to catch NFC.enabled (). This is useful if the NFC is disabled when starting the app. But if the user (who has no idea) disable the NFC at some point in the app I can not capture that event. The only thing I can think of is having a setInterval() in the background checking NFC.enabled.

I would appreciate the development of a listener that will listen when the state of the NFC changes, just like the Cordova Diagnostic plugin.

Thank.

don commented 7 years ago

@fjms Did you come up with an alternate solution?

fjms commented 7 years ago

The functionality existed already https://github.com/dpa99c/cordova-diagnostic-plugin#registernfcstatechangehandler :P I did not see it when I looked at the diagnostic plugin.

don commented 7 years ago

Excellent, thanks for the link