I am trying to upload my app to TestFlight, which using CoreNFC (NDEF).
Unfortunately, I got the error message on Testflight Validate part in (SDK version 13 and 13.1).
I already tried this: Xcode 11 beta can't upload app to TestFlight
but it will Lose NDEF function this: https://stackoverflow.com/a/58128365/5588637
Error messages: Invalid entitlement for core nfc framework The sdk version 13.0 and min OS version 13.0 are not compatible for the entitlement 'com. Apple developer nfc. Readersession formats because NDEF is disallowed
The following worked for me.
Remove all entitlement for NFC other than "NFC tag-specific data protocol"
Finally your entitlement file should have something like this
<key>com.apple.developer.nfc.readersession.formats</key>
<array>
<string>TAG</string>
</array>
Hope it helps :)
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()
I have solved the for iOS 13 TAG entitlment and NDEF is disallowed by:
Attached are a few pictures.
my two cents about.
1) workaround of Josean works
2) my app fails the first time, I can confirm this weird behaviour as CH Wing wrote
3) some hints in "https://forums.developer.apple.com/thread/117329"
4) I added these keys to plist and seems working, not to entitlements. (but at apple dev forum seems it's the way... in PLIST..)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With