Device: iPhone [model], iOS 18.6.2 Xcode: 16.0.x Team: Individual paid Apple Developer Program (not Personal Team), shows as my full name in Xcode
I’m trying to use CoreNFC via NFCTagReaderSession in a small SwiftUI app (part of a larger project).
So far I’ve done: • Enrolled in the Apple Developer Program (individual). • Confirmed that in Certificates, Identifiers & Profiles → Identifiers, my App ID for com.<…> has Near Field Communication Tag Reading enabled. • Created an iOS App Development provisioning profile for that App ID, including: • my Apple Development certificate • my iPhone device • Downloaded the profile, double-clicked it, and set it in Xcode under Signing & Capabilities with: • Team = my full-name team • “Automatically manage signing” off, using the custom profile. • Added the NFC Scan capability in Signing & Capabilities. • Added Privacy - NFC Scan Usage Description (NFCReaderUsageDescription) in Info.plist with a non-empty string.
The app builds and runs on device. When I start the session: func beginScanning() { print("NFCTagReaderSession.readingAvailable =", NFCTagReaderSession.readingAvailable)
session = NFCTagReaderSession(pollingOption: [.iso14443, .iso15693],
delegate: self,
queue: nil)
session?.alertMessage = "Hold your iPhone near your Ori tag."
session?.begin()
}
func tagReaderSession(_ session: NFCTagReaderSession, didInvalidateWithError error: Error) { print("NFC session invalidated:", error.localizedDescription) }
readingAvailable is false, and I immediately see:
NFC session invalidated: Session invalidated unexpectedly
Earlier in this process I was seeing XPC sandbox messages like:
Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.nfcd.service.corenfc was invalidated: failed at lookup with error 159 - Sandbox restriction."
Those went away after I created the explicit iOS App Development profile and pointed the target at it, but the session still invalidates right away and readingAvailable never becomes true.
Safari can read NDEF URL tags on this device, so the NFC hardware is working.
Question:
Is there anything else required on the App ID / provisioning / team side to enable CoreNFC with NFCTagReaderSession for an individual (non-enterprise) developer account? Or any known issues where readingAvailable stays false even with NFC Tag Reading enabled and a custom iOS App Development profile?
Any hints on what I might still be missing would be greatly appreciated.