Implementation Guide

Authentication

A unique access token should be created upon each SDK entry. In order to generate an access token, please refer to Valify's Authentication Documentation.

Security Warning: For improved security, consider implementing the access token fetching logic outside the Activity. This helps keep sensitive credentials secure and reduces potential exposure within the Activity/Fragment code.

Initialization

Declare the following variables

private VIDVLivenessConfig.Builder livenessBuilder;

Initialize your SDK in your activity or fragment as follows

livenessBuilder= new VIDVLivenessConfig.Builder();

Configurations

The SDK builder is separated into two components.

Make sure that you fetched the access token successfully before passing it to the Builder object.

Required Configurations

livenessBuilder
.setBaseUrl("Base Url"); //add your actual base url
.setAccessToken("Access Token"); //add the fetched access token here
.setBundleKey("Bundle Key"); //add your actual bundle key

Optional Configurations

 //UI Configurations
 .setLanguage(String); // "en" is set as default
 .setPrimaryColor(Color.parseColor("hexa_color"));
 .showErrorDialogs(boolean); //default is true
 
 //UX configurations
 .setNumberOfInstructions(int); //default is 4
 .setFailTrials(int); //default is 3
 .setInstructionTimer(int); //default is 10
 
 //If any of the following functions are added, specified action will be removed
 .withoutCloseEyes(); 
 .withoutLookLeft();  	 
 .withoutLookRight();
 .withoutSmile();
 
 .withoutVoiceOver();


// to enable face match service use one of the following lines
.setFaceMatchImage(byte[]);
// or
.setFrontTransactionId(String);

//Other configurations
 .setHeaders(HashMap<>()); // Hashmap, default is empty
 .setSSLCertificate(Inputstream); // Inputstream for a certificate file, no default certificate	 

Configurations Breakdown

This section shows the breakdown of all optional builder configurations.

  1. The following line is where the user interface language is set.

 .setLanguage("<insert_language>"); // ["ar" or "en"] 

The currently supported languages are Arabic and English

  1. The following line is optional and can be used to set your company's branding color to the SDK's user interface.

.setPrimaryColor(Color.parseColor("hexa_color")); // ex:#62CBC9
  1. If the following line is set to true, then an error message will appear in the user interface in the case that the user did not pass the face match or the liveness service.

 .showErrorDialogs(boolean);
  1. The integer set in the following line determines how many instructions the user will need to follow to successfully complete a single SDK experience.

 .setNumberOfInstructions(int);
  1. The integer set in the following line determines how many failed attempts the user has during a single SDK experience.

 .setFailTrials(int); 
  1. The integer set in the following line determines how much time (in seconds) the user will be given to complete each task.

 .setInstructionTimer(int);
  1. If the following line is added, the SDK will not require the user to close their eyes during the experience.

.withoutCloseEyes();
  1. If the following line is added, the SDK will not require the user to look left during the experience.

.withoutLookLeft();
  1. If the following line is added, the SDK will not require the user to look right during the experience.

.withoutLookRight(); 
  1. If the following line is added, the SDK will not require the user to smile during the experience.

.withoutSmile();
  1. If the following line is added, voice-over will be removed from the SDK experience.

 .withoutVoiceOver();
  1. If this field has an image filled, then the face match service is enabled and the image will be compared with an image captured of the user's face during the SDK experience.

 .setFaceMatchImage(byte[]);
  1. If this field has the front OCR transaction ID filled, then the face match service is enabled and the referenced transaction ID will be compared with an image captured of the user's face during the SDK experience.

.setFrontTransactionId(frontTansactionId); 
  1. The following line is optional and can be used to set any headers that may be required for purposes specific to your application. Any headers set will be sent along with each API call made by the SDK.

.setHeaders(HashMap<>());
  1. The following line is optional and can be used to set an SSL certificate that may be required for purposes specific to your application.

.setSSLCertificate(Inputstream); // Inputstream for a certificate file, no default certificate

Start SDK

You need first an instance of SDK's listener vidvLivenessListener Use the following code snippet to run the SDK

livenessBuilder.start(MainActivity.this,vidvLivenessListener);

Last updated