Legacy On Android SDK
1.7.0
1.7.0
  • Introduction
  • Overview
    • Requirements
    • Prerequisites
    • Downloading
    • Setup
    • Initialization
      • Custom headers
    • BiometridOn
      • Create process
      • Get current step
      • Get previous step
      • Get remaining steps
      • Get completed steps
      • Get process data
      • Submit form
      • Submit file
      • Submit selfie with ID card
      • Submit form with files
      • Submit multiple files
      • Submit ID document
      • Video conference
    • Liveness Detection
      • Basic detection
      • Liveness Customisation
      • Generate Liveness Surface
  • Enums
    • StepType
    • VideoConferenceState
    • Doctype
Powered by GitBook
On this page
  • Callback params
  • Implementation example
  1. Overview
  2. BiometridOn

Submit selfie with ID card

BiometridOn liveness detection surface acts on an isolated environment and its represented as a fragment that can be added on any activity.

In this particular case, the following method requires two adicional parameters representing the paths to the ID card images that have to be collected previously to this step.

To call the surface:

BiometridOn.getInstance().startLivenessDetection(String token, StepType stepType, DocType docType, Customisation customisation, ArrayList<String> files, Context context);

The final result will fall under the same callback as a normal file submission. Be aware that if the liveness detection fails then no matching will be made.

Since the validation of the document takes longer than normal procedures, the developer has to wait for an answer in the onPusherEventsCallback and expecting the events "idcard-processed" and "selfie-compare-processed".

idcard-processed: id document validation results are ready

selfie-compare-processed: matching results are ready

Callback params

submitIdCard Callback

Callback

Boolean status

Status of request

StepType previous

Previous step

StepType next

Next step

JsonObject json

JsonObject data from request

Errors e

Errors object

Implementation example

public class ExampleActivity extends Activity implements OnProcessCallback {
    private ArrayList<String> files;
    
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_example);

        LivenessCustomisation customisation = new LivenessCustomisation();
        customisation.setLivenessToken("LIVENESS TOKEN");
        customisation.setPublicKey("PUBLIC KEY");
        
        BiometridOn.getInstance().startLivenessDetection("TOKEN", StepType.IdCard, DocType.IdCard, customisation, files, this);
    }
    
    @Override
    public void onDataSubmissionCallback(Boolean status, StepType previous, StepType next, JsonObject json, Errors e) {

    } 

     @Override
    public void onPusherEventsCallback(@NonNull String s, @NonNull String event, @NonNull JSONObject jsonObject, @Nullable Errors errors) {
        
    }

...
}
PreviousSubmit fileNextSubmit form with files

Last updated 5 years ago