Closed advatar closed 5 years ago
I'd say that your MRZ Key is in correct.
If the number is shorter than 9 chars and includes < characters, then you need to include the < characters in the key (the checksum should come out the same).
passportNumber 89332616 dateOfBirth 040531 expiryDate 200210 mrzKey 89332616404053172002101
That is what I have. Looks ok to me. I noticed however that secureMessaging has not been set here: https://github.com/AndyQ/NFCPassportReader/blob/master/Sources/NFCPassportReader/TagReader.swift#L208
so, it should really be 89332616< then I guess. Testing
That < did the trick but now I get disconnected:
019-07-05 19:27:12.278648+0200 NFCPassportReaderApp[3938:1385928] [CoreNFC] 00000002 81cf5d80 -[NFCTagReaderSession transceive:tagUpdate:error:]:706 Error Domain=NFCError Code=100 "Tag connection lost" UserInfo={NSLocalizedDescription=Tag connection lost}
Error reading tag - Tag connection lost
ERROR - The operation couldn’t be completed. (NFCPassportReader.TagError error 0.)
tagReaderSession:didInvalidateWithError - Error Domain=NFCError Code=200 "Session invalidated by user" UserInfo={NSLocalizedDescription=Session invalidated by user}
Cool, got it to work now! Thge trick seems to be to just put the phone on the passport and not move it.
Working on a MRZ scanner now. Will submit PR when it is done.
Glad that sorted the problem. Will add this to the docs!
Just started playing with this and get this log in the console
Any pointers to what could have gone wrong? It is a Swedish passport btw.