Liveness Detection
This section contains the necessary knowledge to understand the Liveness engine in BiometridStandard.
BiometridStandard.getInstance().startLivenessDetection(data: data, customization: customization, i18n i18n, viewController: self, callback: self)
Parameter
Description
data: [String: Any]?
Data if is necessary to pass information from other step
customization: Face01WrapperCustomization?
Class to change layout customization
i18n: [String: String]?
Json with keys and values to override texts of liveness layout
viewController: UIViewController
View Controller to open the liveness engine
callback: ProcessCallback
callback
Implementation example
import UIKit
import BiometridStandardSDK
class ViewController: UIViewController, ProcessCallback {
override func viewDidLoad() {
super.viewDidLoad()
}
@IBAction func startLivenessDetectionBtn(_ sender: Any) {
let data: [String: Any] = ["front": "base64",
"back": "base64",
"doctype": "idcard"]
let i18n: [String: String] = ["FaceTec_action_ok": "OK",
"FaceTec_action_im_ready": "I'm Ready"]
let customization = Face01WrapperCustomization()
customization.showBrandingImage(true)
BiometridStandard.getInstance().startLivenessDetection(data: docBuilder, customization: customization, i18n: i18n, viewController: self, callback: self)
}
func livenessResultCallback(response: LivenessResponseDetails?, error: Errors?) {
if error != nil {
print(error?.rawValue)
return
}
print("response", response)
}
func livenesStateCallback(state: LivenessState, error: Errors?) {
if error != nil {
print(error?.rawValue)
return
}
print("state", state)
}
}
Callback params
response: LivenessResponseDetails?
Object with the session id, face scan and auditTrail
error: Errors?
Errors associated enum
state: LivenessState
Liveness current state changes
error: Errors?
Errors associated enum
Was this helpful?