Skip to main content

Capture API

Markdown
Methods to start a session
MethodDescription
prepareSelfieCamera(_:config:)Prepares the selfie camera
prepareSelfieCamera(_:config:prepareInfo:)Prepares the selfie camera with PrepareInfo metadata
prepareDocumentCamera(_:config:)Deprecated since iOS SDK 3.5.0. Prepares the document camera
open(_:)Opens the prepared selfie camera
open(_:webAppToken:)Opens the selfie camera for a User Journey, passing the journey token
open(_:idSmartOptions:)Opens the selfie camera against a reference process, passing UnicoIDSmartOptions
openDocument(_:delegate:)Deprecated since iOS SDK 3.5.0. Opens the prepared document camera with a DocumentEnums
warning

For security reasons, iOS SDK 3.5.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.

Capture options / parameters

PrepareInfo — metadata to identify the user session.

FieldTypeRequiredDescription
externalUserIdStringyesUser identifier within your system. Hashed with SHA-256 before transmission.
useCaseStringnoIdentifier for the context or flow currently running. Transmitted in plain text.

UnicoIDSmartOptions — reference process for the capture. Available from iOS SDK 3.4.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.

DocumentEnums — Deprecated since iOS SDK 3.5.0. See Enums.

Result types and fields

SelfieResult — object returned on successful selfie capture.

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

DocumentResult — Deprecated. Never returned since iOS SDK 3.5.0. Object returned on successful document capture. Same fields as SelfieResult.