ios13 Missing required entitlement for NFCTagReaderSession

I'm diving into iOS 13's new CoreNFC capabilities, and I'm struggling to get NFCTagReaderSession working. After setting up my entitlements and instantiating an NFCTagReaderSession and delegate I attempt to start the session by calling

nfcTagReaderSession?.begin()
. My session immediately gets invalidated with this error:


Error Domain=NFCError Code=2 "Missing required entitlement" UserInfo={NSLocalizedDescription=Missing required entitlement}


I have updated my distribution profile accordingly , I have followed the documentation here for my entitlements file: https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_developer_nfc_readersession_formats

I have also added the appropriate "Privacy - NFC Scan Usage Description" in my Info.plist.


My developement profile contains only one string "NDEF" when I enable NFC reading in capabilities.


Has anyone gotten this to work yet? Is this just a problem with Xcode 11 or iOS 13?

Replies

Your entitlements file will need an extra string in the array, value "TAG", in order to use NFCTagReaderSession:


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

I have modified my entitlement as you mentionned...but event with that I got error "Error Domain=NFCError Code=2 "Missing required entitlement" UserInfo={NSLocalizedDescription=Missing required entitlement}"


I guess this is due to my appId capabities : When you select NFC tag reading capabilities into your AppID identifier, do you have any configuration ?

Issue fixed by updating Apple Program Dev License !!!
From now, full NFC Tag Reading capabilities are available into my iOS Dev profile !!!

Not able to read data from the NFC tag using SendCommand . the entitlements and info.plist values are in place.

I am able to create a session and connect to the tag.

I am experiencing the same problem as @VaibhavLaghane, where I am able to create a session and connect to the tag. When I try to send a command, I get the missing entitlements error. Did you happen to find a solution for that?