PassiveFaceLiveness (Deprecated)
Smart camera that captures a reliable selfie of your user using artificial intelligence, capable of detecting and disapproving snapshots and recordings. Ideal for your onboarding.
Required permissions
In the info.plist
file, add the permissions below:
Permission | Reason | Required? |
| To capture the user selfie | Yes |
Utilization
First, instantiate an object of type ** PassiveFaceLiveness
:**
PassiveFaceLiveness.Builder
Parameter | Required? |
Usage token associated with your CAF account | Yes |
Identifier of the user for the purpose of identifying a fraudulent profile | No, only used for analytics |
Enables/disables data collection for analytics | No, the default is |
Changes the default settings of the stability sensor. The threshold of this sensor is in the range of the last two accelerations collected from the device. | No. The default is "Keep the phone still" and 1.5, respectively |
Changes the settings used for capturing the selfie. The parameter indicates the time in milliseconds between the correct face fitting and the actual capture of the picture. | No. The standard is 2.0 |
Changes the document masks for success, failure and normal. Also allows you to change the sound and cancel buttons at the top of the screen | No |
Change the color of the sound and cancel buttons that are at the top of the screen. Also change the color of the popup buttons, inflated before each document. | No |
Enables/disables sounds and the sound icon in the SDK | No. The default is |
Show/hide the lower middle label (which contains the document name) | No. The default is |
Show/hide the central label (which contains the status) | No. The default is |
Change the default network settings | No. The default is 60 (seconds) |
Sets the proxy settings, as explained here | No. The default is |
Enables/disables the capture preview. If | No. The default is |
Allows you to set the quality in the compression process. By default all captures are compressed. The method expects values between 0 and 1.0 as parameters, 1.0 being the best quality compression (recommended). | No. The default is 1.0 |
Allows to customize messages displayed in the "status" balloon during the capture and analysis process. | No. The pattern is this |
Binds a proof-of-life attempt to a cpf | No. The default is |
Binds a proof-of-life attempt to a name | No. The default is |
Enables/disables manual capture. The | No. The default is disabled |
Enable/disable multi-language support | No. The default is enable |
Allows you to enable and configure video capture. | No. The default is disabled |
Sets how long the image URL will last on the server until it is expired. Expect to receive a time interval between "30m" to "30d". Examples:
| No. The default is |
Allows you to set the capture per image. The beforePictureInterval attribute sets the time the user should stay with the face docked in the mask. The | No. The default is enabled. For |
Sets the type of mask used in the captures. There are three types:
| No. The default is |
Delay the activity after the completion of each step. This method can be used to display a success message on the screen itself after the capture, for example. | No. The default is |
Allows you to customize the SDK's open-eye validation settings. The method takes as parameter | No. The default is |
Allows you to set the capture resolution. The method takes as parameter a | No. The default is |
Resolution | Description |
| Specifies appropriate capture settings for output video and audio bit rates suitable for 3G sharing |
| Specifies the appropriate capture settings for the output video and audio bitrates suitable for sharing over WiFi |
| Specifies appropriate capture settings for high-quality video and audio output |
| Specifies appropriate capture settings for high-resolution photo quality output |
| Specifies appropriate capture settings for high-resolution photo quality output |
| Specifies the appropriate capture settings for video output at 720p quality (1280 x 720 pixels) |
| Capture settings suitable for 1080p (1920 x 1080 pixels) quality video output |
| Capture settings suitable for 2160p (3840 x 2160 pixels) quality video output |
Allows you to choose the environment in wich the SDK will run (production, beta). The method takes as parameter an enum | No. The default is |
Enum | Description |
| Will use the Trust Platform production environment to register the SDK executions. |
| Will use the Trust Platform beta environment to register the SDK executions. |
Each environment (beta and production) requires its own specific mobileToken, generated in the Trust platform of the respective environment.
MessageSettings
Attribute | Default Value |
Message displayed when SDK is in the process of opening | "Aguarde..." |
Static label present at the bottom of the activity | "Registro facial" |
Message displayed when the algorithm does not recognize a face | "Não encontramos nenhum rosto" |
Message displayed when the face is not fitted correctly to the mask | "Encaixe seu rosto" |
Message displayed when there is a very small face | "Aproxime o rosto" |
Message displayed when more than one face is detected | "Mais de um rosto detectado" |
Message displayed when the user is in the correct position for capture | "Segure assim" |
Message displayed when proof-of-life verification rejects the selfie | "Não conseguimos capturar seu rosto. Tente novamente." |
Message displayed during proof-of-life verification. | "Verificando selfie…" |
Message displayed when a processing problem or error occurs in the API response. | "Ops, tivemos um problema ao processar sua imagem. Tente novamente." |
Message displayed when both eyes are closed. | "Não use óculos escuros e mantenha os olhos abertos." |
After creating an object of type PassiveFaceLiveness
, start the PassiveFaceLivenessController
by passing this object as a parameter in the constructor:
Getting the result
To get the result, you must implement the PassiveFaceLivenessControllerDelegate
delegate in your controller:
PassiveFaceLivenessResult
Parameter | Can it be null? |
Selfie picture taken or image of the best frame taken from the video - if VideoCapture format enabled. | Yes, in case of error |
Path of the video on the device | Yes, in case of error |
Url containing the jpeg selfie on our temporary server | Yes, in case of error |
Signed response from the CAF server that confirmed that the captured selfie has a real face (it is not a snapshot or video). Use this parameter if you want an extra layer of security by checking that the signature of the response is not broken, caused by an interception of the request. If it is broken, there is a strong indication of request interception | Yes, in case of error or server unavailability |
Identifier of this run on our servers. If possible, save this field and send it along to our API. This way we will have more data about how the user behaved during the execution | Yes, if the user sets |
Defines the face of the camera that was used. Use | No |
PassiveFaceLivenessFailure
Superclass that leads to the SDK shutdown. To find out what the reason was, find out which object class has the ** isKindOfClass()
** method, equivalent to instanceof
in Java and is
in Dart:
isKindOfClass() | Description | Exemple |
| The token entered is not valid for the corresponding product | Parameterize "test123" as token in the SDK builder |
| You are missing some mandatory permission to run the SDK | Start DocumentDetector without camera permission granted |
| Internet connection failure | User was without internet during facematch in FaceAuthenticator |
| When an SDK request receives a status code of failure | In theory, it shouldn't happen. If it does, let us know! |
| There is no space on the user device's internal storage | When there is no space on the internal storage while capturing the document photo |
Examples
Customizing the Layout
You can customize the layout by creating an object of type PassiveFaceLivenessLayout
and passing it as a parameter to PassiveFaceLivenessBuilder
:
Last updated