NFCPassportReader
public final class NFCPassportReader : NSObject
extension NFCPassportReader: NFCTagReaderSessionDelegate
A class responsible for reading and authenticating NFC passport data.
This class represent the entrypoint for the NFCPassportReader package and
if reading is performed successfully, it returns data as NFCPassportModel
that allows the access to the info read smartly.
See also
NFCPassportModel
-
Reads passport data using the provided passport number, date of birth and date of expiry.
The function uses
MRZKeyGeneratorto generate the MRZ (Machine-Readable Zone) key from the provided info.Throws
An error if there’s an issue with the NFC session, the authentication or data reading.
Declaration
Swift
public func readPassport(passportNumber: String, dateOfBirth: String, dateOfExpiry: String) async throws -> NFCPassportModelParameters
passportNumberThe passport number reported on the document.
dateOfBirthThe holder date of birth, also reported on the document.
dateOfExpiryThe document date of expiry reported on it.
Return Value
An
NFCPassportModelcontaining passport data. -
readPassport(mrzKey:Asynchronous) Reads passport data using the provided MRZ (Machine-Readable Zone) key.
Throws
An error if there’s an issue with the NFC session, the authentication or data reading.
Declaration
Swift
public func readPassport(mrzKey: String) async throws -> NFCPassportModelParameters
mrzKeyThe MRZ key used for authentication.
Return Value
An
NFCPassportModelcontaining passport data. -
Declaration
Swift
@available(iOS 13.0, *) public func tagReaderSessionDidBecomeActive(_ session: NFCTagReaderSession) -
Declaration
Swift
@available(iOS 13.0, *) public func tagReaderSession(_ session: NFCTagReaderSession, didInvalidateWithError error: Error) -
Declaration
Swift
@available(iOS 13.0, *) public func tagReaderSession(_ session: NFCTagReaderSession, didDetect tags: [NFCTag])
View on GitHub
NFCPassportReader Class Reference