Thanks for being a part of WWDC25!

How did we do? We’d love to know your thoughts on this year’s conference. Take the survey here

NFC scanning session not detecting tags

Some background:

  • We are developing an app that needs to scan NFC tags
  • We are following this documentation for our app
  • We (assume) we've gotten all the correct entitlements for our app
  • Our app correctly shows the NFC scanning prompt
  • We are using up-to-date iPhones to test
  • We tested scanning using a different NFC app on the app store and were able to successfully scan the tag
  • We're using NFC NDEF tags to test

The problem:

  • Nothing is being detected in the scan
  • Nothing in the example application when we downloaded it down and loaded it onto a test device (reminder that the app from the app store was able to read our tag)
  • When connected to the debugger, our delegate function is not firing (tested with breakpoints and print statements). The following is the signature of our delegate function:
func readerSession(_ session: NFCNDEFReaderSession, didDetectNDEFs messages: [NFCNDEFMessage])

Is there something that we're missing to get the NFC scanning to work? Perhaps some kind of entitlement? If anyone has any ideas or paths to follow that'd be greatly appreciated. Thanks!

Would like to clarify one thing in the sample you are working from. That sample includes both the readerSession(_:didDetectNDEFs:) and the readerSession(_:didDetect:) functions, for demonstrating their use, but as indicated in the documentation, the existence of the latter overrides the former, and you would not get a callback to readerSession(_:didDetectNDEFs:) without removing the other one first.


Argun Tekant /  DTS Engineer / Core Technologies

Thanks, I see that now. We are currently only implementing the following methods:

func readerSession(_ session: NFCNDEFReaderSession, didInvalidateWithError error: any Error)

func readerSessionDidBecomeActive(_ session: NFCNDEFReaderSession)

func beginScanning()

func readerSession(_ session: NFCNDEFReaderSession, didDetectNDEFs messages: [NFCNDEFMessage])

and are still not getting any scans. We also tried the sample code with the func readerSession(_ session: NFCNDEFReaderSession, didDetect tags: [NFCNDEFTag]) commented out and are still not getting any scans.

NFC scanning session not detecting tags
 
 
Q