Privacy Policy and Terms & Conditions of Use

When using our plugin, please make sure that you agree with our Privacy Policy and our Terms and Conditions of Use.


If you use Dart in a version below 2.12, check the compatible version here.



In the file ROOT_PROJECT/android/app/build.gradle, add:

android {

    dataBinding.enabled = true
    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8

//To perform layout customization from the SDK import the following libraries
dependencies {
    implementation ""
    //native Android SDK that the plugin implements
    implementation 'com.combateafraude.sdk:passive-face-liveness:6.0.0-rc06'

    //design libraries that you will use in your layout (these are used in our example template for customization)
    implementation ''
    implementation 'androidx.constraintlayout:constraintlayout:2.0.2'


In the ROOT_PROJECT/ios/Podfile, add to the end of the file:

source ''
source '' # or '' if CDN is down

Finally, add the camera permission to the file ROOT_PROJECT/ios/Runner/Info.plist:

<string>To capture the selfie</string>

To enable text and voice in Portuguese, in your project, in the ROOTPROJECT/ios directory, open the .xcworkspace file in Xcode and add in Project > Info > Localizations the language Portuguese (Brazil).


Add the plugin to your ROOT_PROJECT/pubspec.yaml file:


                ref: passive-face-liveness-v4.30.0

Release Candidate

                ref: passive-face-liveness-v5.0.0-rc06


PassiveFaceLiveness passiveFaceLiveness = new PassiveFaceLiveness(mobileToken: mobileToken);

// Other customization parameters

PassiveFaceLivenessResult passiveFaceLivenessResult = await passiveFaceLiveness.start();

if (passiveFaceLivenessResult is PassiveFaceLivenessSuccess) {
    // The SDK was successfully closed and the selfie was captured
} else if (passiveFaceLivenessResult is PassiveFaceLivenessFailure) {
    // The SDK was closed due to some failure and the selfie was not captured
} else {
    // The user simply closed the SDK, with no result

Disabling Security Validations for Testing

We are constantly taking actions to make the product more and more secure, mitigating a number of attacks observed in the capture process and, consequently, reducing as many possible identity frauds as possible. The SDK has some blocks that may prevent its execution in certain contexts. To disable them, you can use the methods as shown in the example below:

PassiveFaceLivenessAndroidSettings androidSettings =
        emulatorSettings: true,
        rootSettings: true,
        useDeveloperMode: true,
        useAdb: true,
        useDebug: true,

Attention! Disabling security validations is recommended for test environments only. For publishing your application in production, we recommend using the default settings.

General customizations

Each environment (beta and production) requires its own specific mobileToken, generated in the Trust platform of the respective environment.

Example of use

PreviewSettings previewSettings = new PreviewSettings(
    show: true,
    title: "Is the photo good?",
    subTitle: "See if the photo is sharp",
    confirmLabel: "Yes, it's good!",
    retryLabel: "Take it again");

Example of use

MessageSettings messageSettings = new MessageSettings(
    stepName: "Example message",
    faceNotFoundMessage: "Example message",
    faceTooFarMessage: "Example message",
    faceTooCloseMessage: "Example message",
    faceNotFittedMessage: "Example message",
    multipleFaceDetectedMessage: "Example message",
    verifyingLivenessMessage: "Example message",
    holdItMessage: "Example message",
    invalidFaceMessage: "Example message");



Collecting the result

The PassiveFaceLiveness return object is of abstract type PassiveFaceLivenessResult. It can be an instance of PassiveFaceLivenessSuccess, PassiveFaceLivenessFailure, or PassiveFaceLivenessClosed.



The existing fault types are:

  • InvalidTokenReason: when the token entered is invalid. It should not occur in a production environment;

  • PermissionReason: when some mandatory permission was not granted by the user. It will only occur in a production environment if your app does not ask the user or the user manually disables it before starting;

  • NetworkReason: server connection failure. It will occur in production if the user's device is not connected to the Internet;

  • ServerReason: failure in some request to our servers.

  • SecurityReason: when the device is not safe to run the SDK.

  • StorageReason: when the device does not have enough space to capture a photo. This can happen in production;

  • LibraryReason: when some internal failure made it impossible to run the SDK. It may occur due to configuration errors in the project, and should not occur in production;

Customizing iOS view

For iOS customization, it is required that the Flutter plugins are added locally to the project. The customization is performed natively with the ViewCode approach.

****Click here **** and access the example with a guide to using this feature.

Last updated


2023 © Caf. - All rights reserved