chariotsolutions / phonegap-nfc

PhoneGap NFC Plugin
MIT License
706 stars 559 forks source link

Check for hardware and if enabled #140

Closed deefactorial closed 9 years ago

deefactorial commented 9 years ago

I have been getting errors adding listners and I find myself asking clients if they have the hardware and if it is enabled.

It would be nice if there was an api to check for hardware and if it is enabled.

Here is a reference on how to do it in android: https://stackoverflow.com/questions/7618657/how-to-check-whether-nfc-is-enabled-or-not-in-android

deefactorial commented 9 years ago

here is an adroid activity to detect hardware and if it's enabled: https://code.google.com/p/ndef-tools-for-android/source/browse/ndeftools-util/src/org/ndeftools/util/activity/NfcDetectorActivity.java

don commented 9 years ago

You'll get error message in the failure callback if nfc does not exist or is disabled. Every api call checks this. This was fixed in #37.

deefactorial commented 9 years ago

You need better documentation on the returned error message. specifically that it includes the string "NO_NFC" or "NFC_DISABLED" in the error callback.