cancel
Showing results for 
Search instead for 
Did you mean: 

How to access ST25DV registers on iOS using React Native if NfcV is not supported?

shahbaz
Associate II

I am working on a React Native project for an NFC app that needs to run on both iOS and Android. I am using the react-native-nfc-manager library to perform NFC operations. The NFC tag I am using is ST25DV, which supports NDEF and NfcV (ISO15693) technologies.

In my app, I need to perform:

  • Writing different types of NDEF messages (URI, AAR, etc.).
  • Writing directly to static registers (e.g., RFA1SS, ENDA1, RF_PWD_1, etc.).

For writing to registers, I need to access raw memory blocks, which requires NfcV commands.

According to the react-native-nfc-manager documentation, NfcV is not supported on iOS. That leaves me only with NDEF, as the tag only supports NDEF and NfcV.

My questions:

  • Is there any way to access or write to those registers on iOS without NfcV?

  • Is there a workaround to enable or simulate NfcV support on iOS?

  • Or am I limited to NDEF-only operations on iOS with this tag?

Here’s a snippet from my current code that uses NfcV to write a static register (works on Android) I haven't tested that code on iOS yet (as I haven't setup React Native on mac yet for iOS development)

```

await NfcManager.requestTechnology(NfcTech.NfcV);
const tag = await NfcManager.getTag();

const res = awaitr NfcManager.transceive([
0x02, // Request Flag
0xA1, // Command Code for Write Config Register
0x02, // IC Mfg Code fot ST25DV
0x09, // Pointer Address of ENDA1 register
0x3F, // Value of ENDA1
]);

```

This discussion is locked. Please start a new topic to ask your question.
1 ACCEPTED SOLUTION

Accepted Solutions
victor laraison
ST Employee

 

Hi,

When using the customCommand in iOSCoreNFC, the ICMfgcode (e.g., 0x02) is automatically appended by iOSCoreNFC itself. Therefore, you should not include this parameter within the customRequestParameters.

Additionally, please note that currently, only the non-addressed mode appears to be supported (flag 0x02). I have not been able to successfully send custom commands in Addressed Mode using iOSCoreNFC, and the reason for this is unclear.

Kindly try removing the 0x02 from your customRequestParameters and let me know the results.

Br,

View solution in original post

8 REPLIES 8
Ulysses HERNIOSUS
ST Employee

Hi,

on community there was some time back another post on react native. Maybe it helps:

https://community.st.com/t5/st25-nfc-rfid-tags-and-readers/configuration-security-session-via-rf-not-working/m-p/727556

BR, Ulysses

victor laraison
ST Employee

Hi,

On iOS, Apple’s Core NFC framework supports reading and writing NDEF messages and ISO15693 tags, but does not expose low-level transceive commands for NfcV (ISO15693). This means you cannot send custom raw commands to the tag registers like you do on Android.

If you want to perform operations equivalent to raw transceive commands on iOS, you need to use the dedicated ISO15693 command methods provided by Core NFC (and exposed in react-native-nfc-manager if supported). These include commands like:

  • readSingleBlock
  • readMultipleBlocks
  • writeSingleBlock
  • getSystemInfo
  • stayQuiet
  • select
  • resetToReady
  • etc.

So , you must  "wrap" raw transceive commands into every iOS ISO15693 Core NFC commands.
you must translate your required operation into one or more of the standard ISO15693 commands supported by iOS.

Hope it helps,

Br

Hi Victor,

 

Thank you. That helps a lot. I tried the iso15693HandlerIOS and it seems to be working with iOS. Commands like readSingleBlock are working fine, however, I couldn't execute the custom commands. 15693-3 says I can run custom commands from 0xA0 to 0xDF, which is different for each chip? Anyhow, for instance I want to run the 'Write Config' command (0xA1) to write the RFA1SS register to lock Area 1 using PWD_1. I set up the command like this based on request format:

shahbaz_0-1758262011690.png

const res = await NfcManager.iso15693HandlerIOS.customCommand({
flags: 0x02,
customCommandCode: 0xa1,
customRequestParameters: [0x02, 0x04, 0x05],
});

However, I receive error upon running this command. Is the command not setup properly?

 

 

victor laraison
ST Employee

 

Hi,

When using the customCommand in iOSCoreNFC, the ICMfgcode (e.g., 0x02) is automatically appended by iOSCoreNFC itself. Therefore, you should not include this parameter within the customRequestParameters.

Additionally, please note that currently, only the non-addressed mode appears to be supported (flag 0x02). I have not been able to successfully send custom commands in Addressed Mode using iOSCoreNFC, and the reason for this is unclear.

Kindly try removing the 0x02 from your customRequestParameters and let me know the results.

Br,

finn-eaton01
Associate

You're correct iOS does not support NfcV (ISO15693) via Core NFC, so direct register access using NfcV commands isn't possible on iOS.
Unfortunately, that means you're limited to NDEF operations only for ST25DV tags on iOS.
No real workaround exists unless Apple expands Core NFC support so for now, full access is Android-only.

victor laraison
ST Employee

Hi Finn,

You’re mistaken — iOS has supported ISO15693 protocol since iOS 13. Operations are definitely not limited to NDEF; you can access the full range of ST25DV features on iOS.

I recommend you install the STMicro iOS NFC Tap app from the App Store and test it yourself before making assumptions.

Best regards,

Hi Victor,

I tried removing the ICMfgCode from the customRequestParameters. It still fails and returns error. 

I have attached my code snapshot

 

async function writeConfigIos(
  setTagInfo: any,
  setTagStatus: any,
  icMfgCode: number
) {
  try {
    await NfcManager.requestTechnology(NfcTech.Iso15693IOS);
    const tag = await NfcManager.getTag();
    const tagID = tag?.id;
    console.log("Tag Found: ", tagID);

    setTagInfo(tagID);

    // Writing to Config Registers
    const res = await NfcManager.iso15693HandlerIOS.customCommand({
      flags: 0x02,
      customCommandCode: 0xa1,
      customRequestParameters: [0x04, 0x05],
    });
    console.log("Write Config Reg (RFA1SS) Response: ", res);

  } catch (ex) {
    console.log("iOS Custom Command Response: ", ex);
  } finally {
    NfcManager.cancelTechnologyRequest();
    setTimeout(() => setTagStatus(0), 1000);
  }
}

Hi Victor,

Please disregard my previous response. 

I did a silly thing and didn't provide the Present Password command before writing to Config Register.

What you recommended worked well. I removed the ICMfgCode and Presented Password prior to writing to register. It works. My modified code is attached below.

async function writeConfigIos(
  setTagInfo: any,
  setTagStatus: any,
  icMfgCode: number
) {
  try {
    await NfcManager.requestTechnology(NfcTech.Iso15693IOS);
    const tag = await NfcManager.getTag();
    const tagID = tag?.id;
    console.log("Tag Found: ", tagID);

    setTagInfo(tagID);

    // Writing to Config Registers
    const res0 = await NfcManager.iso15693HandlerIOS.customCommand({
      flags: 0x02,
      customCommandCode: 0xb3,
      customRequestParameters: [
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
      ],
    });
    console.log("Present Password Response: ", res0);

    const res1 = await NfcManager.iso15693HandlerIOS.customCommand({
      flags: 0x02,
      customCommandCode: 0xa1,
      customRequestParameters: [0x08, 0x07],
    });
    console.log("Write Config Reg (RFA3SS) Response: ", res1);

  } catch (ex) {
    console.log("iOS Custom Command Response: ", ex);
  } finally {
    NfcManager.cancelTechnologyRequest();
    setTimeout(() => setTagStatus(0), 1000);
  }
}