Skip to main content

Receiving the result

The SDK returns the capture result through callbacks defined in the delegate interfaces used during the capture session.

AcessoBioSelfieDelegate
onSuccessSelfie

Called when the image is captured successfully. Returns a SelfieResult 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.
func onSuccessSelfie(_ result: SelfieResult!) {
let base64 = result.base64
let encrypted = result.encrypted // JWT to send to your backend
}
encrypted usage
  • The encrypted attribute is strictly intended for sending the image through the by Client APIs. It must not be opened or serialized — its characteristics may change without prior notice. Unico is not responsible for any damages resulting from improper handling.
  • The base64/encrypted files may vary in size depending on device quality, generated photo size, and Unico's business rules. Do not limit the size of the string generated by the SDK in your programming logic or infrastructure.
Base64 to bitmap

If you need to convert base64 to a bitmap, the standard method does not work directly on iOS — split the string at the comma (,) first. See How to convert a Base64 string into a Bitmap image to show it in an ImageView?.

onErrorSelfie

Called when an error occurs during capture. Returns an ErrorBio object with getCode() and getDescription(). See Error handling for the full list of error codes and recommended handling.

func onErrorSelfie(_ errorBio: ErrorBio!) {
let code = errorBio.getCode()
let description = errorBio.getDescription()
}
AcessoBioDocumentDelegate
onSuccessDocument

Called when the document image is captured successfully. Returns a DocumentResult object with:

  • base64 — captured image; can be used to display a preview.
  • encrypted — JWT payload that must be sent to your backend within 10 minutes and must never be modified or deserialized.
func onSuccessDocument(_ result: DocumentResult!) {
let base64 = result.base64
let encrypted = result.encrypted // JWT to send to your backend
}
onErrorDocument

Called when an error occurs during document capture. Returns an ErrorBio object. See Error handling for the full list of error codes.

func onErrorDocument(_ errorBio: ErrorBio!) {
let code = errorBio.getCode()
let description = errorBio.getDescription()
}