revtel / react-native-nfc-manager

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

Writing doesn't work on iOS 16 #602

Closed duytuan001 closed 1 year ago

duytuan001 commented 1 year ago

NFC ReWriter App and the lib don't work on iOS 16. Other native apps are working with my tag.

My tag: ISO 14443-3A NXP-Mifare Classic 1k, Techs: NfcA, Ndef, MifareClassic

My code: ` import NfcManager, { NfcTech, } from 'react-native-nfc-manager'; async function writeNdef({type, value}) { let result = false;

try {
  await NfcManager.requestTechnology(NfcTech.Ndef, {
    alertMessage: 'Ready to write some NDEF',
  });

  let bytes = null;
  if (type === 'TEXT') {
    bytes = Ndef.encodeMessage([Ndef.textRecord(value)]);
  } else if (type === 'URI') {
    bytes = Ndef.encodeMessage([Ndef.uriRecord(value)]);
  }

  if (bytes) {
    await NfcManager.ndefHandler.writeNdefMessage(bytes);
    result = true;
  }
} catch (ex) {
  console.warn(ex);
} finally {
  NfcManager.cancelTechnologyRequest();
}

return result;

} `

github-actions[bot] commented 1 year 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.

github-actions[bot] commented 1 year ago

This issue was closed because it has been stalled for 5 days with no activity.