Building the SDK

Creating a Liveness SDK Instance

To create an instance of CafFaceLivenessSDK, use the CafBuilder class. This builder provides methods to configure the SDK according to your requirements.

Builder Methods

Parameter
Description
Required

setScreenCaptureEnabled(Boolean)

Enables or disables screen capture. Default: false.

setStage(CafStage)

Defines the environment stage (e.g., PROD, BETA). Default: PROD.

setLoadingScreen(Boolean)

Enables or disables the loading screen. Default: false.

setListener(CafLivenessListener)

Sets a listener for liveness verification events.

Example Implementation (Flutter)

Below is an example of how to integrate the Liveness SDK in Flutter. This setup includes configuring the builder, handling SDK events, and starting the liveness verification.

  void _initializeLivenessSDK() {
    _livenessSDK = CafFaceLiveness();
    _livenessSDK.setStage(CafStage.prod);
    _livenessSDK.setScreenCaptureEnabled(true);
    _livenessSDK.setLoadingScreen(true);
    _livenessSDK.setListener(_setupLivenessListener());
  }

Last updated

Logo

2023 © Caf. - All rights reserved