The NXP app for Android can read MiFare DESFire EV1 tags, so I figured there must be a way to do similar in an app on iOS13. However, it appears I must know in advance the ISO7816 AID to populate the select-identifiers property of my app's Info.plist before I will get tags from the reader session. I believe my code is correct to setup the reader session and begin. But I my didDetect callback never fires. Is there some sort of wildcard select-identifier that would present all tags to my callback?
Is there a wildcard AID for NFC to read any MiFare DESFire EV1 tag?
the same problem here
Did you try to read directly with some code like that ?
func tagReaderSession(_ session: NFCTagReaderSession, didDetect tags: [NFCTag]) {
print("tagReaderSession")
session.connect(to: tags.first!) { (error: Error?) in
if error != nil {
session.invalidate(errorMessage: "Connection error. Please try again.")
return
}
switch tags.first {
case .miFare(let discoveredTag):
print("Got a MiFare tag!",
discoveredTag.description,
discoveredTag.identifier as NSData,
discoveredTag.mifareFamily)
if case let NFCTag.miFare(tag) = tags.first! {
session.connect(to: tags.first!) {
(error: Error?) in
if error != nil {
session.invalidate(errorMessage: "Connection error. Please try again.")
return
}
/* Here, do what you want with the tag, such as : */
let command: [UInt8] = [
0x90, /* CLA : PICC */
0x6A, /* INS : GET AIDS */
0x00,
0x00,
0x00 /* length */
]
let data = Data(bytes: command, count: command.count)
let response:[UInt8] = try await self.tag!.sendMiFareCommand(commandPacket: data).bytes
}
}
...