Closed christianevan closed 9 months ago
@christianevan How do you solve this issue, I'm having the same using expo I'm trying to read or write using "await NfcManager.requestTechnology(NfcTech.Ndef);" but never end this method.
@christianevan How do you solve this issue, I'm having the same using expo I'm trying to read or write using "await NfcManager.requestTechnology(NfcTech.Ndef);" but never end this method.
I haven't resolved it yet. But I guess the easiest way is to make a custom native module for the NFC reader and then use it in Expo.
You can check this: https://docs.expo.dev/modules/native-module-tutorial
any update? @christianevan @nfuenmamelt
async function readNdef() { NfcManager.start(); try { // register for the NFC tag with NDEF in it await NfcManager.requestTechnology(NfcTech.Ndef); console.log('Testing'); // the resolved tag object will contain
ndefMessage
property const tag = await NfcManager.getTag(); if (tag) { console.warn('Tag found', tag); } else { console.warn('No NDEF tag found'); } } catch (ex) { console.warn('Oops!', ex); throw ex; } finally { ()=>NfcManager.cancelTechnologyRequest(); } }I just followed the implemented code of react native nfc manager. But it always throws an error: "TypeError: Cannot convert null value to object". I use expo in my project. As you can see in my code, the console log is never shown.