# nfc_manager 4.2.1

A Flutter plugin providing access to NFC features on Android and iOS.




## Installing
```
export PUB_HOSTED_URL=https://pub.mirror.p-hatan.com
flutter pub add nfc_manager
```
Published: 2026-04-03T10:32:12.636338Z
Expected archive SHA-256: 1b8d3788ed71bb34f59878a445e433891eb2268353289515c1542b2780151fe6

Available in cache; verification: upstream_checksum
## Direct dependencies
- flutter: map[sdk:flutter]
- meta: ^1.17.0
- ndef_record: ^1.4.2

## Package README (untrusted upstream documentation)
# nfc_manager

A Flutter plugin providing access to NFC features on Android and iOS.

## Setup

### Android

* Add [android.permission.NFC](https://developer.android.com/reference/android/Manifest.permission.html#NFC) to your `AndroidManifest.xml`.

### iOS

* Add [Near Field Communication Tag Reader Session Formats Entitlements](https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_developer_nfc_readersession_formats) to your entitlements.
* Add [NFCReaderUsageDescription](https://developer.apple.com/documentation/bundleresources/information_property_list/nfcreaderusagedescription) to your `Info.plist`.
* Add [com.apple.developer.nfc.readersession.iso7816.select-identifiers](https://developer.apple.com/documentation/bundleresources/information_property_list/select-identifiers) to your `Info.plist` as needed.
* Add [com.apple.developer.nfc.readersession.felica.systemcodes](https://developer.apple.com/documentation/bundleresources/information_property_list/systemcodes) to your `Info.plist` if you specify `NfcPollingOption.iso18092` in `startSession`, otherwise an error will occur.

## Usage

### Handling the Session

```dart
import 'package:nfc_manager/nfc_manager.dart';

// Check the availability of NFC on the current device.
NfcAvailability availability = await NfcManager.instance.checkAvailability();

if (availability != NfcAvailability.enabled) {
  print('NFC may not be supported or may be temporarily disabled.');
  return;
}

// Start the session.
NfcManager.instance.startSession(
  pollingOptions: {NfcPollingOption.iso14443}, // You can also specify iso18092 and iso15693.
  onDiscovered: (NfcTag tag) async {
    // Do something with an NfcTag instance...
    print(tag);

    // Stop the session when no longer needed.
    await NfcManager.instance.stopSession();
  },
);
```

### Working with NfcTag

An `NfcTag` instance is typically not used directly. Instead, convert it to a platform-specific tag class by calling that class's static method `from`.

```dart
import 'package:nfc_manager/nfc_manager.dart';
import 'package:nfc_manager_ndef/nfc_manager_ndef.dart';

final Ndef ndef = Ndef.from(tag);

if (ndef == null) {
  print('This tag is not compatible with NDEF.');
  return;
}

// Do something with an Ndef instance...
print(ndef);
```

The following platform-specific tag classes are available:

#### Android only

* `NfcAAndroid`
* `NfcBAndroid`
* `NfcFAndroid`
* `NfcVAndroid`
* `IsoDepAndroid`
* `MifareClassicAndroid`
* `MifareUltralightAndroid`
* `NfcBarcodeAndroid`
* `NdefAndroid`
* `NdefFormatableAndroid`

#### iOS only

* `FeliCaIos`
* `MiFareIos`
* `Iso15693Ios`
* `Iso7816Ios`
* `NdefIos`

#### Cross-platform abstractions (separate packages)

* `Ndef` ([nfc_manager_ndef](https://pub.dev/packages/nfc_manager_ndef))
* `FeliCa` ([nfc_manager_felica](https://pub.dev/packages/nfc_manager_felica))
* and more...

## Changelog
## 4.2.1

* Fixes crash when re-opening the app from background.

## 4.2.0

* Add Swift Package Manager support.
* Bump dependencies.

## 4.1.1

* Avoid iOS SDK version constraints caused by the addition of `NFCReaderError.Code`.

## 4.1.0

* Deprecated `NfcManager#isAvailable`. Use `NfcManager#checkAvailability` instead.
* Fix iOS background issue.
* Add more `NFCReaderError.Code` for iOS.
* Bump versions.
* Update doc.

## 4.0.2

* Update README.

## 4.0.1

* Update package page.

## 4.0.0

**Has many breaking changes.**

* Rename the following:
  * `NfcA` to `NfcAAndroid`
  * `NfcB` to `NfcBAndroid`
  * `NfcF` to `NfcFAndroid`
  * `NfcV` to `NfcVAndroid`
  * `IsoDep` to `IsoDepAndroid`
  * `MifareClassic` to `MifareClassicAndroid`
  * `MifareUltralight` to `MifareUltralightAndroid`
  * `NdefFormatable` to `NdefFormatableAndroid`
  * `MiFare` to `MiFareIos`
  * `FeliCa` to `FeliCaIos`
  * `Iso15693` to `Iso15693Ios`
  * `Iso7816` to `Iso7816Ios`
  * Options for `startSession`:
    * `onError` to `onErrorIos`
    * `invalidateAfterFirstRead` to `invalidateAfterFirstReadIos`
    * `alertMessage` to `alertMessageIos`
  * Options for `stopSession`:
    * `alertMessage` to `alertMessageIos`
    * `errorMessage` to `errorMessageIos`
* Remove the following:
  * `Ndef` (Instead use the [`nfc_manager_ndef`](https://pub.dev/packages/nfc_manager_ndef) package or `NdefAndroid` / `NdefIos`)
  * `timeout` (Instead use the `async getTimeout()` method)
  * `maxTransceiveLength` (Instead use the `async getMaxTransceiveLength()` method)
  * `NfcError` (Instead use the `NfcReaderSessionErrorIos`)
  * `NfcErrorType` (Instead use the `NfcReaderErrorCodeIos`)
* Add the following:
  * `ndef_record.dart` library that provides access to [`ndef_record`](https://pub.dev/packages/ndef_record) package.
  * `nfc_manager_android.dart` library that provides access to Android API.
  * `nfc_manager_ios.dart` library that provides access to iOS API.
  * `async setTimeout()` method.
  * `noPlatformSoundsAndroid` option to `startSession` method.
* Upgrade Flutter.
* Update README.

## 3.5.1

* Make compatible for Kotlin 2.1.0

## 3.5.0

* Upgrade Flutter.
* Fix analyze issues.

## 3.4.0

* Fix iOS background isolate issue.
* Add namespace to Gradle for Android.
* Rebuild projects on Flutter stable channel.

## 3.3.0

* Added `invalidateAfterFirstRead` argument to `startSession`. This enables `restartPolling` on iOS.

## 3.2.0

* Fix build issues.

## 3.1.1

* Upgrade kotlin version.

## 3.1.0

* Fix Null-Safety related issues. The following properties are now nullable.
  * `IsoDep#hiLayerResponse`
  * `IsoDep#historicalBytes`
  * `Iso7816#historicalBytes`
  * `Iso7816#applicationData`
  * `MiFare#historicalBytes`

## 3.0.0+2

* Update doc.

## 3.0.0+1

* Flutter format.

## 3.0.0

* Upgrade to null safety.

## 2.0.3

* Fix type conversion errors in `FeliCa#readWithoutEncryption` and `FeliCa#requestServiceV2`.

## 2.0.2

* Fix a bug in calling `FeliCa.sendFeliCaCommand` method.

## 2.0.1+1

* Update README.

## 2.0.1

* Fix an error when initializing plugin for non-NFC Android devices.

## 2.0.0+2

* Update doc.
* Flutter format.

## 2.0.0+1

* Update doc.

## 2.0.0

**Has many breaking changes.**

* Remove `startNdefSession` and `NdefDiscoveredCallback`.
* Rename `startTagSession` to `startSession`.
* Rename `TagPollingOption` to `NfcPollingOption`.
* Rename `NfcSessionError` to `NfcError`.
* Rename `NfcSessionErrorType` to `NfcErrorType`.
* Rename `TagDiscoveredCallback` to `NfcTagCallback`.
* Rename `NfcSessionErrorCallback` to `NfcErrorCallback`.
* Rename `ISO15693` to `Iso15693`.
* Rename `ISO7816` to `Iso7816`.
* Rename `fromTag` to `from`. (e.g. `MiFare.fromTag(tag)` -> `MiFare.from(tag)`)
* Add `NdefTypeNameFormat` enum.
* Add `NdefFormatable`, `MifareClassic` and `MifareUltralight` classes.
* Add `Ndef#read` method.
* Add command-implementations for `FeliCa` and `Iso15693`.
* Upgrade flutter environment.

## 1.3.2+4

* Update README.

## 1.3.2+3

* Update README.

## 1.3.2+2

* Update README.

## 1.3.2+1

* Update README.

## 1.3.2

* Fix crash on Ndef write and writeLock error.

## 1.3.1

* Fix a bug where the error callback was not called.

## 1.3.0

* Add callback to handle error from session.

## 1.2.0

* Make discovered callback async.

## 1.1.0+1

* Update readme.

## 1.1.0

* Add constants.
* Fix misspelled name.
* Fix xcode build warning.
* Increase the Flutter SDK requirement to ^1.10.0.

## 1.0.1

* Fix error on invoking transceive method.

## 1.0.0

* Add platform-specifc-tag operations.
* Remove `NfcSessionType` enum.
* Migrate to pubspec platforms manifest.
* More consistent naming.

## 0.5.1

* Update flutter project files.
* Additional fix for migration to AndroidX.

## 0.5.0

* Migrate to AndroidX.

## 0.4.0+2

* Fix typo on README

## 0.4.0+1

* Update README

## 0.4.0

* Rename `NfcNdef#cachedNdef` to `NfcNdef#cachedMessage`.
* Add `NfcSessionType` enum.
* Add `NfcTagPollingOption` enum.

## 0.3.0

* Add `NdefRecord#createMimeRecord`.
* Add optional parameters `alertMessageIOS` and `errorMessageIOS` displayed in iOS system UI.
* Fix error on deserializing null message on dart side.

## 0.2.0

* Split `startSession` into `startNdefSession` and `startTagSession`.
* Improve doc.

## 0.1.1

* Fix crash on serializing nil message on ios side.
* Add example project.
* Improve doc.

## 0.1.0+2

* Improve doc.

## 0.1.0+1

* Improve doc.

## 0.1.0

* Add iOS 13 features.

## 0.0.1

* Initial release.







 
