semlette / nfc_in_flutter

Cross-platform flutter plugin for reading and writing NFC tags. Not maintained anymore - not looking for new maintainer, fork instead.
MIT License
120 stars 119 forks source link

How to check if NFC is enabled on device #52

Open akouyate opened 4 years ago

akouyate commented 4 years ago

Hi need to know if user enabled nfc in is settings. Only supported information is provided. Is it planned to add this features ?

Thanks for this great job

obrunsmann commented 4 years ago

When calling NFC.isNDEFSupported on an android phone with NFC support but disabled NFC in settings the method returns false. After enabling NFC in settings the method returns true.

knapp95 commented 4 years ago

@obrunsmann I think when NFC disabled in settings NFC.isNDEFSupported return false :(

obrunsmann commented 4 years ago

@knappu ehhh.. sorry that was a Typo. Of course you are Right. I corrected my answer.

But this is the expected behavior for me. Android suggests to add the uses-feature option to the Android manifest to hide all apps which require NFC from the store as soon as you do not have some NFC capability on your phone: https://developer.android.com/guide/topics/connectivity/nfc/nfc#manifest

knapp95 commented 4 years ago

But in my application I want to tell the user when he has disabled nfc to enable, and that's option's would be very helpful in this plugin. something like 'isNfcEnabled'

staminna commented 2 years ago

knappu: did you manage to find a solution?

knapp95 commented 2 years ago

yeah, i mean this future not contains that option