nfc_foreground_dispatch

A Flutter plugin that enables Android NFC foreground dispatch to prevent the system NFC handler from interfering with your app's NFC operations.

Why?

When your Flutter app uses nfc_manager (or similar) to read/write NFC tags, Android's system NFC handler can intercept the tag first — showing system popups or launching other apps. This plugin claims NFC priority for your app while it's in the foreground.

Usage

import 'package:nfc_foreground_dispatch/nfc_foreground_dispatch.dart';

// Enable — suppresses system NFC handler
await NfcForegroundDispatch.enable();

// Disable — returns NFC control to the system
await NfcForegroundDispatch.disable();

Android Only

This plugin only affects Android. iOS handles NFC differently and does not require foreground dispatch.

Permissions

The plugin declares android.permission.NFC automatically.