SDK Response

SDK Listener

Use the following code snippet to receive SDK callbacks

 VIDVLivenessListener vidvLivenessListener=new VIDVLivenessListener() {
           @Override
           public void onLivenessResult(VIDVLivenessResponse livenessResponse) {
                if (livenessResponse instanceof Success) {
                
                    
                    
                //an example code to use the response in your app : 
                //this variable will have a base64 captured image during the Liveness proccess.
                String base64Image =  ((Success) livenessResponse).vidvLivenessResult.capturedImage(); 
                // Add your code here
                
                } else if (livenessResponse instanceof BuilderError) {
                
                    // Add your code here
        
                } else if (livenessResponse instanceof ServiceFailure) {
        
                    // Add your code here
            
                } else if (livenessResponse instanceof UserExit) {
            
                    // Add your code here
          
                }else if (livenessResponse instanceof CapturedActions){
            
                    // Add your code here
            
            	}
            }
    	};

Response Instances

Success : Process finished successfully

CapturedActions: Images captured are returned in real-time

Note: ForCapturedImagesinstance, images are not processed yet

UserExit : Process terminated by the user with no errors

ServiceFailure : Process finished with the user's failure to pass the service requirements

BuilderError : Process terminated due to an error in the builder

Note: Check your configurations

Primary Response Object

VIDVLivenessResult

Note: This is the first-level object that contains all the second-level objects

Object Body

  • facematchTransactionID <string>

  • facematchSuccess <boolean>

  • livenessSuccess <boolean>

  • capturedImage <base64-string>

hmacDataList <list>
  • serviceID: face_match

  • hmacDigest <string>

  • rawResponse <string>

The raw response in hmacDataList should be mapped to the result object as per the HMAC Validation Documentation

Instance Responses

Success

  • vidvLivenessResult <object>

CapturedActions

capturedActions <object>
  • id <int>

  • action <string>

  • faceSample <base64-string>

  • status <boolean>

capturedAction contains the images captured of the user's face during the SDK experience

UserExit

  • vidvLivenessResult <sub-object>

  • step <string>

Note: step <string> identifies the point where the user chose to exit the SDK

ServiceFailure

  • errorCode <int>

  • errorMessage <string>

  • vidvLivenessResult <object>

BuilderError

  • errorCode <int>

  • errorMessage <string>

Last updated