Biometric KYC

Perform a Biometric KYC job

Biometric KYC is exposed as a flow which performs the following high level steps:

  1. Displays instructions to the user

  2. Requests camera permissions (if not already granted)

  3. Captures and saves Liveness and Selfie images

  4. Submits the job to the Smile ID API

  5. Delivers the result back to the caller

Usage

import SwiftUI
import SmileID

struct MyView: View, BiometricKycResultDelegate {
    @State private var idInfo: IdInfo
    var body: some View {
        ZStack {
            SmileID.biometricKycScreen(
                idInfo: idInfo,
                delegate: self
            )
        }
    }
    
    func didSucceed(selfieImage: URL, livenessImages: [URL], jobStatusResponse: BiometricKycJobStatusResponse) {
        print("Successfully submitted Biometric KYC job")
    }

    func didError(error: Error) {
        print("An error occurred - \(error.localizedDescription)")
    }
}

To use the view in UIKit:

let biometricKycScreen = SmileID.biometricKycScreen(...)
let controller = UIHostingController(rootView: biometricKycScreen)
controller.modalPresentationStyle = .fullScreen
navigationController?.present(controller, animated: true)

Last updated