revtel / react-native-nfc-manager

React Native NFC module for Android & iOS
MIT License
1.39k stars 317 forks source link

CAN'T READ MIFARE CLASSIC TAG AGAIN AFTER NAVIGATE BACK TO THE SCAN SCREEN #552

Closed aces96 closed 2 years ago

aces96 commented 2 years ago

HI, im working on a app and we use a mifare classic tag when i start the app for the first time i can read the tag successfully and i navigate to the next screen if a i press the android back button and return to the scan screen i can't read the tag

try { // register for the NFC tag with NDEF in it await NfcManager.requestTechnology(NfcTech.MifareClassic); // the resolved tag object will containndefMessage` property const tag = await NfcManager.getTag();

  console.warn('Tag found', tag);
  parseNDEF(tag)
  //this.setState({now:false});
} catch (ex) {
  console.warn('Oops!', ex);
  // this.setState({now:false});

} finally {
  // stop the nfc scanning
  await NfcManager.cancelTechnologyRequest();
  console.log("NFC :  Fin Scan")
  //this.setState({now:false});
  //this.setState({disableCamera:false})
}`