Receiving the result
The SDK returns the capture result through callbacks defined in the listener interface used during the capture session.
onSuccessSelfie
Called when the image is captured successfully. Returns a ResultCamera object with:
base64— captured image; can be used to display a preview in your application.encrypted— JWT payload that must be sent to your backend to complete biometric validation via the REST API. Must be submitted within 10 minutes and must be transmitted unchanged — do not parse, re-serialize, or modify it.
- Kotlin
- Java
override fun onSuccessSelfie(result: ResultCamera) {
val base64 = result.base64
val encrypted = result.encrypted // JWT to send to your backend
}
@Override
public void onSuccessSelfie(ResultCamera result) {
String base64 = result.getBase64();
String encrypted = result.getEncrypted(); // JWT to send to your backend
}
onSuccess
Called upon successfully completing the WebApp flow. Returns a SuccessResult object containing a processId used to query the result of the customer validation process via the REST API.
- Kotlin
- Java
override fun onSuccess(result: SuccessResult) {
val processId = result.processId
}
@Override
public void onSuccess(SuccessResult result) {
String processId = result.getProcessId();
}
onErrorSelfie
Called when an error occurs during capture. Returns an ErrorBio object with a code and description. See Error handling for the full list of error codes and recommended handling.
- Kotlin
- Java
override fun onErrorSelfie(errorBio: ErrorBio) {
val code = errorBio.code
val description = errorBio.description
}
@Override
public void onErrorSelfie(ErrorBio errorBio) {
String code = errorBio.getCode();
String description = errorBio.getDescription();
}
onSuccessDocument
Called when the document image is captured successfully. Returns a ResultCamera object with:
base64— captured image; can be used to display a preview in your application.encrypted— JWT payload that must be sent to your backend to complete document validation via the REST API. Must be submitted within 10 minutes and must be transmitted unchanged — do not parse, re-serialize, or modify it.
- Kotlin
- Java
override fun onSuccessDocument(result: ResultCamera) {
val base64 = result.base64
val encrypted = result.encrypted // JWT to send to your backend
}
@Override
public void onSuccessDocument(ResultCamera result) {
String base64 = result.getBase64();
String encrypted = result.getEncrypted(); // JWT to send to your backend
}
onErrorDocument
Called when an error occurs during document capture. Returns an ErrorBio object with a code and description. See Error handling for the full list of error codes and recommended handling.
- Kotlin
- Java
override fun onErrorDocument(errorBio: ErrorBio) {
val code = errorBio.code
val description = errorBio.description
}
@Override
public void onErrorDocument(ErrorBio errorBio) {
String code = errorBio.getCode();
String description = errorBio.getDescription();
}