NFC for React Native, built for the New Architecture and Expo Development Builds.
Requires React Native 0.76+ with the New Architecture. Use an NFC-capable physical device to test scans.
npm install react-native-nfc-manager@betav4 is currently beta. Pin the resolved version for reproducible installs. See migration when upgrading an existing app.
Expo Go cannot load this native module. Add the config plugin to app.json:
{
"expo": {
"plugins": ["react-native-nfc-manager"]
}
}Install the development client and build the native app:
npx expo install expo-dev-client
npx expo prebuild
npx expo run:ios --device
# Or: npx expo run:android --device
npx expo start --dev-clientRebuild after changing native dependencies or plugin options. For iOS capabilities and plugin options, see Expo setup.
- iOS: run
pod install, then configure NFC capabilities and usage description. - Android: the module is autolinked; check NFC permissions and device support, then rebuild the app.
Call this function from a user action. It prevents overlapping scans and awaits cleanup before allowing another request.
import NfcManager, {NfcTech} from 'react-native-nfc-manager';
let scanning = false;
async function readNdef() {
if (scanning) return;
scanning = true;
let requestAttempted = false;
try {
await NfcManager.start();
requestAttempted = true;
await NfcManager.requestTechnology(NfcTech.Ndef);
const tag = await NfcManager.getTag();
console.log('NDEF records', tag?.ndefMessage ?? []);
} catch (error) {
console.warn('NFC scan ended', error);
} finally {
try {
if (requestAttempted) {
await NfcManager.cancelTechnologyRequest();
}
} catch (cleanupError) {
console.warn('NFC cleanup failed', cleanupError);
} finally {
scanning = false;
}
}
}For a complete React screen and session lifecycle, see reading NDEF tags.
| Technology | Android | iOS |
|---|---|---|
| NDEF, NFC-A, ISO-DEP | ✅ | ✅ |
| NFC-V / ISO 15693 | NfcV |
Iso15693IOS |
| MIFARE | MifareClassic, MifareUltralight |
MifareIOS |
| FeliCa | NfcF |
FelicaIOS |
See the full technology and handler table. Actual tag support depends on the device and OS.
Start with the v4 documentation index.
- Installation and runtime requirements
- Expo setup · iOS setup · Android setup
- API and handlers
- Expo troubleshooting
- Support policy · Changelog
The development example exercises the New Architecture API. Contributing includes build instructions and the NFC ReWriter app.
Created by whitedogg13.