Receiving the result
The SDK returns the capture result through callbacks defined in the listener interface used during the capture session.
onSuccess is only delivered when the camera is opened with a webAppToken — the process.webAppToken returned by Create Process. See User Journeys.
onSuccessSelfie must still be implemented to satisfy the listener interface, but its result is not used in a Unico API integration.
onSuccess
Called upon successfully completing the journey. 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();
}