Receiving the result
The SDK returns the capture result through callbacks defined in the delegate interfaces 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. It is required: without it, the SDK fails with error 74001.
onSuccessSelfie must still be implemented to satisfy the delegate 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.
- Swift
- Objective-C
func onSuccess(_ result: SuccessResult!) {
let processId = result.processId
}
- (void)onSuccess:(SuccessResult *)result {
NSString *processId = result.processId;
}
onErrorSelfie
Called when an error occurs during capture. Returns an ErrorBio object with the code and desc properties. See Error handling for the full list of error codes and recommended handling.
- Swift
- Objective-C
func onErrorSelfie(_ errorBio: ErrorBio!) {
let code = errorBio.code
let description = errorBio.desc
}
- (void)onErrorSelfie:(ErrorBio *)errorBio {
NSInteger code = errorBio.code;
NSString *description = errorBio.desc;
}