So I was at the WWDC and was able to detect NFC Cards provided by Apple Labs with the following code:
nfcSession = NFCNDEFReaderSession(delegate: self, queue: nil, invalidateAfterFirstRead: false)
nfcSession.begin()
And the delegate methods:
func readerSession(_ session: NFCNDEFReaderSession, didInvalidateWithError error: Error) {
DispatchQueue.main.async {
print("Error:" + error.localizedDescription)
}
}
func readerSession(_ session: NFCNDEFReaderSession, didDetectNDEFs messages: [NFCNDEFMessage]) {
print("Did detect NDEFs.")
for message in messages {
for record in message.records {
print(record.identifier)
print(record.payload)
print(record.type)
print(record.typeNameFormat)
}
}
}
How ever, I want to detect a Mifare Ultralight (Or classic) card under the ISO/IEC 14443 protocol.
Whenever I get the Scan View, nothing happens. Nor the error callback or the success block get called. Is there a way to read this cards?
Thanks a lot!