Skip to main content

1. Function Signature

Quepass.launchJourney(    
        journey: String,    
        govVerification: Bool? = nil,    
        eventId: String? = nil,    
        uid: String? = nil,    
        ticketType: String? = nil,    
        data: String? = nil,    
        signature: String? = nil,    
        isActiveLiveness: Bool = false,    
        isPassiveLiveness: Bool = false,    
        kioskMode: Bool = false,    
        documentType: DocumentType? = nil,    
        documentNumber: String? = nil,    
        documentNumberType: DocumentSearchType? = nil,    
        documentNumberTypeString: String? = nil,    
        biometricType: BiometricType? = nil,    
        callBack: @escaping (Bool, CognetIdentityKitOutputModel) -> Void    
    ) -> UIViewController?    

2. Required Parameters by Journey

JourneyRequired Params
OnboardingdocumentType
AuthenticationdocumentNumber, documentNumberType, biometricType
Transactionuid, biometricType
SearchbiometricType
EventQRRegistrationticketType, eventId
EventBiometricCheckIneventId
EventQRCheckIndata, signature, eventId
EventBiometricCheckInByDocbiometricType, eventId

3. Examples

  • Onboarding:
    Quepass.lounchJourney(    
        journey: CognetJourney.onboarding,    
        isActiveLiveness: true,    
        isPassiveLiveness: true,    
        kioskMode: false,    
        documentType: .idCard    
    ) { status, output in    
        if status, let data = output.data {    
            let uid = data["uid"] as? String    
            let token = data["token"] as? String    
        } else {    
            let error = output.errors?.first?.message ?? "Registration failed"    
        }    
    }    
  • Authentication:
    Quepass.lounchJourney(    
        journey: CognetJourney.authentication,    
        govVerification: true,    
        eventId: "",    
        isActiveLiveness: true,    
        isPassiveLiveness: true,    
        kioskMode: false,    
        documentNumber: "DOC123",    
        documentNumberType: .idCard,    
        biometricType: .face    
    ) { status, output in    
        if status, let data = output.data {    
            let uid = data["uid"] as? String    
            let token = data["token"] as? String    
        }    
    }
  • Transaction:
    Quepass.lounchJourney(    
        journey: CognetJourney.transaction,    
        govVerification: true,    
        eventId: "",    
        isActiveLiveness: true,    
        isPassiveLiveness: true,    
        kioskMode: false,    
        uid: "user-uid",    
        biometricType: .face    
    ) { status, output in    
        if status { /* Transaction verified */ }    
    }    
  • Search:
    Quepass.lounchJourney(    
        journey: CognetJourney.search,    
        govVerification: true,    
        eventId: "",    
        isActiveLiveness: true,    
        isPassiveLiveness: true,    
        kioskMode: false,    
        biometricType: .face    
    ) { status, output in    
        if status, let data = output.data {    
            let uid = data["uid"] as? String    
        }    
    }    
  • Event Registration:
    Quepass.lounchJourney(    
        journey: CognetJourney.eventQRRegistration,    
        uid: nil,    
        govVerification: true,    
        ticketType: "VIP",    
        eventId: "event-123",    
        isActiveLiveness: true,    
        isPassiveLiveness: true,    
        kioskMode: false    
    ) { success, output in    
        if success, let data = output.data {    
            let payload = data["payload"] as? [String: Any]    
            let qrData = payload?["data"] as? String    
            let signature = payload?["signature"] as? String    
        }    
    }    
  • Embedded View (KioskMode / EventBiometricCheckIn):
    if let vc = Quepass.lounchJourney(    
        journey: QuepassJourney.kioskMode,    
        govVerification: true,    
        eventId: "event-123",    
        callBack: { success, output in    
            if success, let data = output.data {    
                let uid = data["uid"] as? String    
            }    
        }    
    ) {    
        present(vc, animated: true)    
    }    
         
 
Response: QuepassIdentityKitOutputModel
         
    public struct QuepassIdentityKitOutputModel {    
        public var code: Int           // 200, 400, etc.    
        public var data: [String: Any]? // Response payload    
        public var errors: [APIErrorModel]?    
    }    
         
    public struct APIErrorModel {    
        public let code: Int    
        public let message: String    
        public let details: String    
    }    
         
  • ExpressVerfication:
Quepass.launchJourney(
            journey: expressVerification,
            identifierType: identifierType,
            identifierNumber: String,
            nationality: String
        ) { status, response in
            print(response)
        }
  • ExpressOnboarding:
Quepass.launchJourney(
            journey: QuepassJourney.ExpressOnboarding,
            isActiveLiveness: SettingsManager.shared.settings.activeLiveness, isPassiveLiveness: SettingsManager.shared.settings.passiveLiveness, kioskMode: SettingsManager.shared.settings.kioskMode, identifierType: identifierType,
            identifierNumber: identifierNumber,
            nationality: nationalityParam
        ) { status, response in
            if !status {
                errorMessage = response.errors?.first?.message ?? "Fastrack registration failed"
                showErrorAlert = true
            } else {
                if let dataDict = response.data,
                   let jsonData = try? JSONSerialization.data(withJSONObject: dataDict, options: [.prettyPrinted]),
                   let jsonString = String(data: jsonData, encoding: .utf8) {
                    result = jsonString
                } else {
                    result = "Registration completed"
                }
 
            }
        }
  • Success data (common fields):
  1. uid — User unique ID
  2. token — Consent token
  3. message — Success message
  4. isSuccess — Boolean