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 MRZKeyGenerator to 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 -> NFCPassportModel

    Parameters

    passportNumber

    The passport number reported on the document.

    dateOfBirth

    The holder date of birth, also reported on the document.

    dateOfExpiry

    The document date of expiry reported on it.

    Return Value

    An NFCPassportModel containing 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 -> NFCPassportModel

    Parameters

    mrzKey

    The MRZ key used for authentication.

    Return Value

    An NFCPassportModel containing 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])