don / cordova-plugin-hce

Cordova plugin for Host Card Emulation (HCE)
Other
28 stars 15 forks source link

How can I check if HCE is available on currently running device #2

Open amz opened 8 years ago

amz commented 8 years ago

It would be great if we could check if device supports hce before registering callback

don commented 8 years ago

There is an Android method to check for HCE. The plugin needs a new API call to support this.

packageManager.hasSystemFeature(PackageManager.FEATURE_NFC_HOST_CARD_EMULATION)

Until then, you could limit the app to android-19 and greater and require HCE in the Manifest.

http://developer.android.com/guide/topics/connectivity/nfc/hce.html#ImplementingService http://developer.android.com/reference/android/content/pm/PackageManager.html#FEATURE_NFC_HOST_CARD_EMULATION

amz commented 8 years ago

Meanwhile i have created an implementation of this. Please take o look at pull request #3.