我在使用 ios 13+ 和 swift 5 从 rfid 芯片读取数据时遇到一个非常基本的问题,我有两个设置(NFCNDEFReaderSession 和 NFCTagReaderSession),
\n\nNFCNDEF阅读器会话:
\n\nimport UIKit\nimport CoreNFC\n\nclass ViewController: UIViewController {\n\n var session: NFCNDEFReaderSession?\n\n override func viewDidLoad() {\n super.viewDidLoad()\n\n session = NFCNDEFReaderSession(delegate: self, queue: DispatchQueue.main, invalidateAfterFirstRead: false)\n session?.begin()\n }\n\n}\n\nextension ViewController: NFCNDEFReaderSessionDelegate {\n\n func readerSessionDidBecomeActive(_ session: NFCNDEFReaderSession) {\n print("active") // called once\n }\n\n func readerSession(_ session: NFCNDEFReaderSession, didDetectNDEFs messages: [NFCNDEFMessage]) {\n print("didDetectNDEFs") // never called\n }\n\n func readerSession(_ session: NFCNDEFReaderSession, didInvalidateWithError error: Error) {\n print(error.localizedDescription) // only called on timeout\n }\n\n}\nRun Code Online (Sandbox Code Playgroud)\n\n … I would like to retrive the UID of MiFare cards. I'm using an iPhone X, Xcode 11 and iOS 13.
I'm aware this wasn't possible (specifically reading the UID) until iOS 13 according to this website: https://gototags.com/blog/apple-expands-nfc-on-iphone-in-ios-13/ and this guy: https://www.reddit.com/r/apple/comments/c0gzf0/clearing_up_misunderstandings_and/
The phones NFC reader is correctly detecting the card however the unique identifier is always returned as empty or nil. I can read the payload however and irrelvant to iOS but I can do this in Android (confirms the …