Start the identification process by calling IdentificationActivity.startForResult in your activity.
Please update the below code with your Client ID and Client Secret from your Customer Dashboard. To support multiple documents and other flow settings also use the Customer Dashboard.
Flow ID specify which verification flow to use. Flow IDs are defined in the Customer Dashboard, section Verification Flow.
This method internally prepares Intent for the identification process and starts an activity:
IdentificationParams params = new IdentificationParamsWithClientSecret(
"< client id >",
"< client secret >",
"< flow ID >", // optional
R.style.AuthenteqThemeBase // optional
);
IdentificationActivity.startForResult(
activity,
MY_REQUEST_CODE,
params
);
val parameters = IdentificationParamsWithToken(
"< client id >",
"< token >",
R.style.AuthenteqThemeBase // optional
)
IdentificationActivity.startForResult(
activity,
REQUEST_CODE_IDENTIFICATION,
parameters
)
Authentication token can only be used for a single verification. Always generate a new token before start a new verification.
Identification completion
onActivityResult will be called in your activity after on-boarding is either finished or canceled. Here you can get the on-boarding 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);
}
}
override fun onActivityResult(
requestCode: Int,
resultCode: Int,
data: Intent?)
{
if (requestCode == REQUEST_CODE_IDENTIFICATION) {
if (data == null) return
if (resultCode == Activity.RESULT_OK) {
IdentificationActivity.getResult(data)?.let { result ->
// process onboarding result
}
} else {
IdentificationActivity.getError(data)?.let { error ->
// process error
}
}
} else {
super.onActivityResult(requestCode, resultCode, data)
}
}