0

Hi I'm writing an app for ndef read/write with react-native-nfc-manager. It successfully works most of the time but sometimes it deletes ndef from "available technologies". I can't write to nfc until clone from another ndef tag with ST25 app.

I couldn't find a way to add cloning on my app with react-native-nfc-manager. One time I achieved to fix the nfc with using direct bytes with writeNdefMessage but didn't work again.

How can I handle this situation on my app? My NFC Write code:

                try {
              await NfcManager.requestTechnology(NfcTech.Ndef)
              await NfcManager.ndefHandler.writeNdefMessage([
               0xD1,0x01,0x0B,0x55,0x04,0x67,0x6F,0x6F,0x67,0x6C,0x65,0x2E,0x63,0x6F,0x6D
              ]);

            } catch (error) {
              console.log(error);
            } finally {
              NfcManager.cancelTechnologyRequest().catch(() => 0);
            }
Eren Talan
  • 51
  • 3
  • Do you handle the `NdefFormatable` Technology? I think a bad write could possibly leave it looking in the formatable state and thus Ndef would not appear on the list of Technologies. – Andrew Mar 09 '23 at 10:32
  • I think my nfc tags doesnt have ndefFormatable. I'm not so familiar with nfc technologies. I would be appreciated if you can explain to me – Eren Talan Mar 15 '23 at 08:05
  • 1
    A number of NFC Tag types are capable of storing Ndef Data as well as other data formats. `NdefFormatable` means that the Tag is capable of storing Ndef data but is not currently configured to so. A lot of Tags come out of the Factory as `NdefFormatable`. For example on a Type 2 Tag the different between formatted and non formatted is that formatted has a standard header and footer bytes written to the data area. Other Tag types have different ways of being configured. If a Tag is blank or corrupted it might not have the right header or footer to signify it is Ndef data on the Tag. – Andrew Mar 15 '23 at 09:18
  • When I tried to formatNdef with ndefFormatable it says unsupported tag api – Eren Talan Mar 15 '23 at 09:21
  • It might help answer if you use the App `TagInfo` from NXP to "Full scan" the Tag when it is a bad state and then "save scan" to a file, which would allow you to post the contents as text here then people can look at the state of the Tag as to why you cannot write to it. – Andrew Mar 15 '23 at 09:28
  • I'm gonna try and let u know – Eren Talan Mar 15 '23 at 09:28

0 Answers0