nfc_pro_manager 3.1.6
nfc_pro_manager: ^3.1.6 copied to clipboard
The industry-grade NFC SDK for Flutter. Supports robust Host Card Emulation (HCE), Identity Emulation, NDEF Read/Write, and ISO-DEP APDU communication with enterprise lifecycle management.
NFC Pro Manager π #
A robust Flutter SDK designed for advanced NFC use cases: payment simulation, smart card communication (ISO-DEP/APDU), and Host Card Emulation (HCE). Built to handle real-world reliability issues like data loss during app startup and connection drops.
β Why Nfc Pro Manager? #
Most Flutter NFC plugins are limited to basic NDEF tag reading. This SDK goes further by providing:
- Full ISO-DEP / APDU support for complex smart card interactions.
- Native Host Card Emulation (HCE) to turn your phone into a smart card.
- Persistent Sessions that keep connections alive for multi-command workflows (crucial for payment).
- Event Buffering which prevents missing card detections during app initialization.
β‘ Quick Start #
await NfcPro.startSession(
onDiscovered: (tag) => print("Card UID: ${tag.uid}"),
);
π Comparison #
| Feature | nfc_manager | nfc_pro_manager |
|---|---|---|
| Raw APDU Commands | β | β Full Support |
| Card Emulation (HCE) | β | β Supported |
| Persistent ISO-DEP | β οΈ Basic | β Optimized |
| Lifecycle Management | β | β Auto-Suspend |
| Event Buffering | β | β Native Queue |
π Usage Examples #
Reading a Smart Card (APDU) #
Interact with banking cards, e-money, or access cards using batch commands:
List<String?> responses = await NfcPro.runScript([
NfcApdu.selectAid("F0010203040506"),
NfcApdu.readBinary(sfi: 1, offset: 0),
]);
Identity Emulation (HCE) #
Turn your Android device into a programmable NFC tag:
await NfcPro.setEmulationId("MY-IDENTITY-TOKEN");
MIFARE Classic Clone Support (Android Only) #
Read full card blocks from a MIFARE Classic tag and write them back to another compatible tag.
final blocks = await NfcPro.readMifareClassic(keyA: 'FFFFFFFFFFFF');
final success = await NfcPro.writeMifareClassic(
blocks: blocks ?? [],
keyA: 'FFFFFFFFFFFF',
startBlock: 0,
);
Note: MIFARE Classic operations are only supported on Android.
Real Output Example #
UID: 04A224B1C39280
Type: android.nfc.tech.IsoDep, android.nfc.tech.NfcA
Content: Secure Identity Token v3
π‘ Common Use Cases #
- π³ E-money reader for balance checking.
- π’ Digital access cards for office or gym entry.
- π Secure login via physical NFC tokens.
- π Smart identity cards for attendance systems.
π Platform Support & Limitations #
| Feature | Android | iOS |
|---|---|---|
| Tag Discovery | β | β |
| APDU (ISO-DEP) | β | β (ISO7816 only) |
| HCE (Emulation) | β | β (Apple Lock) |
| NDEF Write | β | β |
β οΈ iOS CoreNFC Limitations: #
- No HCE: Apple does not allow third-party apps to emulate cards.
- Scanning UI: iOS shows a mandatory system modal during scanning.
- Background: Very limited background scanning compared to Android.
π§ Installation & Setup #
Prerequisites #
- Flutter: >= 3.0.0
- Android SDK: API 30 or higher (automatically enforced by plugin)
- iOS: iOS 12.0+
Installation #
Just add to your pubspec.yaml:
dependencies:
nfc_pro_manager: ^3.1.3
Run flutter pub get and you're done! β
The plugin automatically enforces minSdkVersion 30 on Android. No manual configuration needed!
β Compatibility Matrix #
| Flutter Version | Dart | Android SDK | Status |
|---|---|---|---|
| 3.0.x - 3.5.x | >=3.0 | 30+ | β Supported |
| 4.0.x+ | >=3.3 | 30+ | β Supported |
Note: Pure Kotlin/Java implementation - no NDK required!
π License #
MIT License. Created with β€οΈ for the Flutter community.