Skip to main content

Capture API

Markdown
Methods to prepare a session

Call these methods on the UnicoCheckCamera interface obtained from the SDK builder. After preparation, the CameraListener.onCameraReady(cameraOpener) callback provides the opener to start capture.

MethodDescription
prepareCamera(config, listener)Prepares the selfie camera. listener is a CameraListener.
prepareDocumentCamera(config, listener)Deprecated since Android SDK 6.13.0. Prepares the document camera. listener is a DocumentCameraListener.
warning

For security reasons, Android SDK 6.13.0 and later no longer include the native document capture. The public API still exists for now, but calling it returns error 73905, "Unable to open document camera". It will be removed in an upcoming version. For more information, contact your CSM.

Opening the camera

After onCameraReady fires, call open on the received opener object:

Selfie — UnicoCheckCameraOpener.Camera

MethodDescription
open(listener: iAcessoBioSelfie)Opens the selfie camera
open(listener: iAcessoBioSelfie, webAppToken: String)Opens the selfie camera for a User Journey, passing the journey token
open(listener: iAcessoBioSelfie, idSmartOptions: UnicoIDSmartOptions)Opens the selfie camera against a reference process, passing UnicoIDSmartOptions

Document — UnicoCheckCameraOpener.Document

MethodDescription
open(documentType: DocumentType, listener: iAcessoBioDocument)Deprecated since Android SDK 6.13.0. Opens document capture for the specified type
open(documentType: DocumentType, description: String, listener: iAcessoBioDocument)Deprecated since Android SDK 6.13.0. Opens document capture with a custom description label
Capture options / parameters

UnicoIDSmartOptions — reference process for the capture. Available from Android SDK 6.13.0.

FieldTypeRequiredDescription
referenceProcessIdStringyesId of an earlier, concluded process of the same user, created by your account (for example, the user's Onboarding). Use the id that the Unico API returned when that process was created. This capture compares against it.
useCaseStringyesContext of the operation. Use one of the values listed in Smart Revalidation.
Enablement

This option requires Smart Revalidation enabled for your account. Contact your Unico representative before you use it. Without it, the camera runs the regular capture.

DocumentType

Deprecated since Android SDK 6.13.0. Defines the type of document to be captured. See Enums for the full list.

Result types and fields

ResultCamera — object returned on success.

FieldTypeDescription
base64StringCaptured image in Base64
encryptedStringJWT to be sent to the backend