Ok after lots of fooling around, this worked for me (my use case is that i'm scanning NDEF tags):
And yes this is counterintuitive, but the sad fact is: If you want to scan NDEF tags, you MUST remove the 'NDEF' from the entitlements (this may be an apple bug that is resolved later, this is accurate as of Xcode 12.5)
Remove NDEF from the .entitlements file, so it only contains the following:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.nfc.readersession.formats</key>
<array>
<string>TAG</string>
</array>
</dict>
</plist>
Add the following to the info.plist:
<key>NFCReaderUsageDescription</key>
<string>This app would like to use NFC for some reason.</string>
No need to add "ISO7816 application identifiers for NFC Tag Reader Session" to the info.plist
Read the NDEF tag using code like this:
session = NFCNDEFReaderSession(delegate: self, queue: .main, invalidateAfterFirstRead: true)
session?.alertMessage = "Please hold your tag up against the the rear side of your iPhone, next to the camera."
session?.begin()
readerSession(_ session: NFCNDEFReaderSession, didDetectNDEFs messages: [NFCNDEFMessage])
NFCNDEFReaderSessionDelegate method, which is pretty explicit in mentioning NDEF...) – Lavella