cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove existing password and set a new one in a single NFC session (iOS Swift)?

shuvrak
Associate

I’m working on an iOS(17+ using Swift) app using CoreNFC and need to manage passwords on ST25 tags.

The goal:

  1. Authenticate with the existing password (assuming I already have).
  2. Remove the password (disable protection).
  3. Immediately set a new password in the same NFC session.

The issue:

• The chip doesn’t actually clear the password.

• Commands fail with “Tag connection lost”.

It looks like I’m not reading/writing the configuration pages correctly or missing a required sequence.

What I need

A working Swift implementation that:

• Authenticates with the existing password,

• Removes/clears it,

• Sets a new password,

• All in one NFC session.

Any code snippets or idea would be really helpful.

1 REPLY 1
victor laraison
ST Employee

Hi,

Please, could you check the call to iOSCoreNFC customcommand ? 

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,