CoreNFC: Sending Custom Commands using NFCISO15693Tag protocol

I'm trying to use iOS 13's new CoreNFC capabilities to read\write data to an ISO15693 compatible chip. My app includes the NFC Tag Reader Session Formats Entitlements:


<key>com.apple.developer.nfc.readersession.formats</key>
<array>
  <string>NDEF</string>
  <string>TAG</string>
</array>


The NFCTagReaderSessionDelegate receives an object that conforms the NFCISO15693Tag protocol and I have been successfully called readSingleBlock function to read dtat from the Tag. But whenever I call customCommand to send a proprietary command for reading data from the Tag, I get the following error: "Error Domain=NFCError Code=2 "Missing required entitlement" UserInfo={NSLocalizedDescription=Missing required entitlement}".


Does anyone has managed to get this work? What are the missing entitlements needed to use customCommand function?

Accepted Reply

Ok, so for me iOS 13 beta 4 has solved the issue with the"Missing required entitlement".

Now, I can call the customCommand method without any error...

Replies

I am using swift language and testing on an iPhoneXS. Here is an example of customCommand usage:


tag.customCommand(requestFlags: [.highDataRate],
       customCommandCode: 0xAE,
       customRequestParameters: Data(bytes: [UInt8(0x0D), UInt8(0x01)], count: 2),
       completionHandler: { (response: Data, error: Error?) in
            //completion handler
            })

Looks very similar to what i'm doing, although I'm using the addressed flag, and 0xA5 with no data as the request doesn't require any params.


Perhaps I'll have a play later with a few combinations and take out the addressed flag. Although the tags I'm using don't implement 0xAE, I'll try issuing that command - I'd expect to get an error other than missing entitlement if that's the case.


Is this the only command you've tried?

I was wondering if your ticket has changed the answer yet?
I am stuck because I can't send customCommand 0x35 to Authenticate a chip using the AES Crypto module inside of it.
I hate to say it, but android's NFC framework has a command called

public byte[] transceive (byte[] data)

"Send raw NFC-A commands to the tag and receive the response."
Developers can completely create their own blocks of data to send to the tag and receive the answer in the same little function.
That looks so much better than getting "Custom command code must be between 0xA0 to 0xDF inclusively" when trying to send a "customCommand" 0x35 that is so basic to NFC Tag security.
I hope they allow developers to implement this, and not leave us behind android like that.

I confirm that iOS13 coreNFC custom comand does not work with ".address" request flag !!! . Otherwise you will get an "entitlement" error ??!!!!
Hope it will be fixed in Official release.

This seems to still be happening with iOS 13.1.2. The only ISO15693 command where Apple provided much documentation is readSingleBlockWithRequestFlags. Those docs say that RequestFlagAddress is enabled by default and that the OS will include the tag's identifier with the command. It may be the case that customCommand does that as well, which is why it rejects the attempt to include RequestFlagAddress manually. I don't have a way to verify this -- does anyone have an NFC card emulator or some other way to snoop the NFC traffic?

Is there any reference that .address command does not work? Is there any workaround possible?