Flutter NFC Reader
A new flutter plugin to help developers looking to use internal hardware inside iOS or Android devices for reading NFC tags.
The system activate a pooling reading session that stops automatically once a tag has been recognised. You can also trigger the stop event manually using a dedicated function.
Installation
Add to pubspec.yaml:
and then run the shell
last step import to the project:
How to use
Android setup
Add those two lines to your AndroidManifest.xml
on the top
iOS Setup
Atm only Swift
based Flutter project are supported.
- Enable Capabilities / Near Field Communication Tag Reading.
- Info.plist file, add Privacy - NFC Scan Usage Description with string value NFC Tag.
Read NFC
This function will return a promise when a read occurs, till that very moment the reading session is open.
The promise will return a NfcData
model, this model contains:
- id > id of the tag
- content > content of the tag
- error > if any error occurs
Stop NFC
For better details look at the demo app.