Building the SDK
Quick links: Overview | Building the SDK | Start Liveness Verification | UI Customization | Installation | Current Version | Requirements | Source Code | Result Reference | Release Notes | FAQ
Creating a Liveness SDK instance
Instantiate CafFaceLivenessLiteSDK directly and configure behavior via the constructor and setup parameters.
Constructor
CafFaceLivenessLiteSDK(enableSecurity: Bool = true)enableSecurity
Bool
No
Enables security monitoring: jailbreak detection, instrumentation detection, and dylib monitoring. Default: true. Disable only in automated testing environments.
setup Parameters
From 3.0.0, configuration is supplied to setup rather than to startSDK.
mobileToken
String
Yes
Mobile authentication token
personId
String
Yes
Person ID for liveness
environment
CafEnvironment (enum)
No
.prod (default), .beta, .dev
loading
Bool
No
Shows SDK loading screen (default: true)
customLocalization
String?
No
Use a custom strings table/bundle prefix (e.g., "stringsBundle")
customLocalizationBundle
Bundle?
No
Bundle that contains the custom strings table (maps to iProov options.stringsBundle)
uiCustomization
CerttaUiCustomization?
No
Optional visual branding for the liveness screen: header bar, prompt, mask area and font. See UI Customization
Note: customLocalization maps to the iProov strings table name (omit the .strings extension). When strings live outside the main app bundle (for example inside a redistributed framework), also pass customLocalizationBundle. See the iProov localization guide: iProov Localization.
prewarm
Optional. Requests the session ahead of time so startSDK can open the camera without waiting on the network. Takes no parameters, reports nothing, and is a no-op before setup. The prewarmed session is valid for 90 seconds; if it is unavailable when you start, the SDK falls back to the regular flow. See Start Liveness Verification.
startSDK Parameters
viewController
UIViewController
Yes
The presenting view controller
Calling startSDK before setup reports didFinishWithError(type: .invalidOptionsException, description:).
getVersion
Available from 7.8.0. Static method that returns the SDK version as a String. It needs no instance and no setup, which makes it handy for logging and support tickets.
Example
Atualizado

