revtel / react-native-nfc-manager

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

java.io.IOException #642

Closed davmaene closed 11 months ago

davmaene commented 1 year ago

anyone know why i can't write a tag in my RFID card here is my code i don't know what i did wrong.

  async function writeNdef() {
    let result = false;
    setonwait(true)
    try {

      await NfcManager.requestTechnology([NfcTech.IsoDep, NfcTech.Ndef]);
      const bytes = Ndef.encodeMessage([Ndef.textRecord('Hello NFC')]);

      if (bytes) {
        await NfcManager.ndefHandler.writeNdefMessage(bytes);
        //setonwait(false)
        result = true;
      }
    } catch (ex) {
      //setonwait(false)
      console.warn(" Error on writting Tag => ", ex);
    } finally {
      //setonwait(false)
      NfcManager.cancelTechnologyRequest();
    }
    return result;
  }
github-actions[bot] commented 11 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.