相关疑难解决方法(0)

未检测到 iOS 13、Swift 5、Core NFC MiFare Classic 1K

我在使用 ios 13+ 和 swift 5 从 rfid 芯片读取数据时遇到一个非常基本的问题,我有两个设置(NFCNDEFReaderSession 和 NFCTagReaderSession),

\n\n

NFCNDEF阅读器会话:

\n\n
import 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}\n
Run Code Online (Sandbox Code Playgroud)\n\n …

rfid ios mifare swift core-nfc

8
推荐指数
0
解决办法
2240
查看次数

Reading UIDs of NFC Cards in iOS 13

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 …

nfc ios mifare core-nfc

5
推荐指数
1
解决办法
1105
查看次数

标签 统计

core-nfc ×2

ios ×2

mifare ×2

nfc ×1

rfid ×1

swift ×1