Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the javascript device.nfc variable #24

Closed
wants to merge 1 commit into from

Conversation

semiaddict
Copy link

Adds the javascript variable "nfc" to the "device" object to allow other
code to check if the NFC plugin was successfully initalized and if the
phone supports NFC.
If the phone has NFC support, then the variable device.nfc will be true,
false otherwise.

Note: a real phone support check has been only added to Android.

Adds the javascript variable "nfc" to the "device" object to allow other
code to check if the NFC plugin was successfully initalized and if the
phone supports NFC.
If the phone has NFC support, then the variable device.nfc will be true,
false otherwise.

Note: a real phone support check has been only added to Android.
@don
Copy link
Member

don commented Jan 5, 2013

An Android branch has code that sets the status variable https://github.com/don/phonegap-nfc/commits/nfc-status

I don't like this because nfc.status is not known until after ondeviceready fires.

The code as of 2013-01-04 will return errors when calling exec if NFC is not available on the device or NFC is disabled.

e3968bc#L1R55

If this isn't good enough, I can add a getStatus or checkNfcStatus method that will return NFC_OK or call the error callback with NO_NFC or NFC_DISABLED.

@don
Copy link
Member

don commented Sep 5, 2013

Closing this issue. The callbacks will now call the error message with NO_NFC or NFC_DISABLED when NFC is not available.

@don don closed this Sep 5, 2013
@JohnMcLear
Copy link
Contributor

Nice, thanks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants