For the complete documentation index, see llms.txt. This page is also available as Markdown.

Smart Capture

This guide covers version 7.0.0 and above. For versions below 7.0.0, please see the legacy documentation.

Overview

Smart Capture captures identity documents with guided flows and optional auto capture and preview. It uses the same Certta session as Face Liveness and Document Detector: configure credentials once, then open the capture UI.

On iOS, Smart Capture is integrated through CerttaSmartCapture, CerttaSmartCaptureDelegate and the SmartCapture framework module. CerttaSmartCaptureConfiguration maps to CafSmartCaptureConfig for the unified CafSDKProvider pipeline.

If SmartCapture is not linked in your target, the SDK cannot register a Smart Capture service; CafSDKProvider will not add a capture module for that flow (link the product as required by your distribution).

For Certta session setup (token, user ID, environment), see the Certta session (quick start). For Document Detector (step-based flow, CerttaDocumentDetectorConfiguration), see Document Detector for iOS (Certta).


Prerequisites

Before proceeding, ensure the CAF SDK is properly installed. If you have not done this yet, refer to our installation guide (Swift Package Manager or CocoaPods).

You also need:

  • Camera permission string in Info.plist (NSCameraUsageDescription).

  • Active Certta sessionCertta.shared.configure(configuration:) with non-empty mobileToken and userID (same contract as Face Liveness and Document Detector).

  • SmartCapture framework linked in your target, in addition to CafSDK and any other products your integration requires (see your package / Pod instructions).

<key>NSCameraUsageDescription</key>
<string>We need the camera to capture your document.</string>

CerttaSmartCaptureConfiguration

These map internally to CafSmartCaptureConfig for the unified CafSDKProvider pipeline.

All parameters have defaults; override only what you need.

Parameter
Type
Description

requestTimeout

TimeInterval

Network / request timeout in seconds. Default: 60.

previewEnabled

Bool

Whether the post-capture preview step is enabled. Default: true.

autoCapture

Bool

Whether automatic capture is enabled when supported. Default: true.


Starting Smart Capture

Use the CerttaSmartCapture singleton. Set delegate (or conform the presenting UIViewController to CerttaDocumentDetectorDelegate); resolution matches Document Detector: delegate ?? (presenter as? CerttaDocumentDetectorDelegate).

loadSession(from:configuration:) is available with the same CerttaSmartCaptureConfiguration to preload resources before open. Unified .loading / .loaded events are not delivered to CerttaDocumentDetectorDelegate; use didLog for diagnostics where needed.


Understanding Smart Capture events and results

Smart Capture uses the same CerttaDocumentDetectorDelegate as Document Detector so session, success, failure, and cancel handling stay consistent across Certta document products.

didFinish(signedResponse:)

The string is the signed result from the module. Your backend or CAF integration documentation defines how to validate, decode, and store it. Do not log the full token in production builds.

didFail(_ failure: CerttaDocumentDetectorFailure)

Processing failures from the pipeline — today processingFailed(result:cause:).

didFinishWith(_ error: CerttaError)

Blocking errors (session not configured, camera permission, network, security, initialization, etc.). CerttaError aligns with Face Liveness and other Certta modules. Use localizedDescription / message in alerts.

didCancel()

The user cancelled the flow. Return to the previous screen or offer retry.

didLog(level:message:)

Progress and informational events; map to UI or analytics as needed.

Types for other APIs

CerttaSmartCaptureEvent, CerttaSmartCaptureResult, and CerttaSmartCaptureFailure exist for higher-level or future APIs. The Certta path above uses CerttaDocumentDetectorDelegate for consistency with Document Detector and Face Liveness.


Session and theming

Call Certta.shared.configure(configuration:) before open or loadSession.

Optional Certta.shared.setColorConfiguration(_:) applies when the Smart Capture UI reads session colors from Certta (same pattern as Document Detector and Face Liveness).

Dark / light mode: build CafColorConfiguration using UITraitCollection.current.userInterfaceStyle if you need different palettes per mode.


Choosing Document Detector vs Smart Capture

Product
Entry point
Configuration

Smart Capture

CerttaSmartCapture.shared

CerttaSmartCaptureConfiguration (timeout, preview, auto capture)

Document Detector

CerttaDocumentDetector.shared

CerttaDocumentDetectorConfiguration (flow steps, layout, upload, instructions, …)

Both use CerttaDocumentDetectorDelegate and the same Certta session. Pick Smart Capture for the guided Smart Capture product; pick Document Detector when you need the classic step-based document flow and hub configuration described in Document Detector for iOS (Certta).


Release notes

See GitHub Releases for versions, breaking changes, and minimum Xcode / iOS.


Technical support and usage tips

For more details and advanced usage scenarios, refer to the following resources:

  • GitHub repository: source code, issue tracking, and release notes in the CafSDK GitHub repository.

  • Document Detector (Certta): Document Detector for iOS (Certta) — same delegate, different configuration and flow.

  • Document Detector configurations: Document Detector configurations — CafDocumentDetectorConfig when using the Document Detector path or CafSDKProvider.Builder.

  • FAQs and troubleshooting: check our FAQ section for common issues and troubleshooting tips.

  • Support: for additional assistance, contact our support team or join our developer community forum.

We continuously update the documentation as new features and improvements are released. Stay up to date for future updates!

Last updated