Identification

Start the identification process by calling IdentificationActivity.startForResult in your activity. This method internally prepares Intent for the identification process and starts that activity:

DocumentIdentificationResult.Type[][] documentTypes = new DocumentIdentificationResult.Type[][] {
{
DocumentIdentificationResult.Type.PASSPORT,
DocumentIdentificationResult.Type.DRIVERS_LICENSE,
DocumentIdentificationResult.Type.NATIONAL_ID
}
};
IdentificationActivity.startForResult(activity,
MY_REQUEST_CODE,
null,
"<client id>",
"<client secret>",
documentTypes);

Alternatively, you can start the activity with an assigned custom style (see Customization for more details):

DocumentIdentificationResult.Type[][] documentTypes = new DocumentIdentificationResult.Type[][] {
{
DocumentIdentificationResult.Type.PASSPORT,
DocumentIdentificationResult.Type.DRIVERS_LICENSE,
DocumentIdentificationResult.Type.NATIONAL_ID
}
};
IdentificationActivity.startForResult(activity,
MY_REQUEST_CODE,
null,
"<client id>",
"<client secret>",
documentTypes,
styleResourceId);

onActivityResult will be called in your activity after onboarding is either finished or canceled. Here you can get the onboarding result and process it:

@Override protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
if (requestCode == MY_REQUEST_CODE) {
if (resultCode == RESULT_OK) {
final IdentificationResult resul = IdentificationActivity.getResult(data)
// process onboarding result
}else{
// process is canceled by user
final Throwable error = IdentificationActivity.getError(data);
if(error != null) {
// process error
}
}
} else {
super.onActivityResult(requestCode, resultCode, data);
}
}