"Flutter NFC Hce Reader Example"
"The Nfc Hce Reader Example is a sample that utilizes the nfc_manager library to read NFC host card emulation tags on Android. The Nfc Hce Aid used is D2760000850101."
"Reference: https://pub.dev/packages/nfc_manager"
Android Setup
- Add android.permission.NFC to your
AndroidManifest.xml
.<uses-permission android:name="android.permission.NFC" /> <uses-feature android:name="android.hardware.nfc" android:required="true" /> <uses-feature android:name="android.hardware.nfc.hce" android:required="true" />
iOS Setup
-
Add Near Field Communication Tag Reader Session Formats Entitlements to your entitlements.
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>com.apple.developer.nfc.readersession.formats</key> <array> <string>NDEF</string> <string>TAG</string> </array> </dict> </plist>
-
Add NFCReaderUsageDescription to your
Info.plist
. -
Add com.apple.developer.nfc.readersession.felica.systemcodes and com.apple.developer.nfc.readersession.iso7816.select-identifiers to your
Info.plist
as needed.<key>com.apple.developer.nfc.readersession.felica.systemcodes</key> <array> <string>0000</string> </array> <key>com.apple.developer.nfc.readersession.iso7816.select-identifiers</key> <array> <string>D2760000850101</string> </array>