SmartComply iOS SDK
The SmartComply iOS SDK is a native Swift library that delivers a fully self-contained identity verification flow for iOS apps. Drop in one SwiftUI view and the SDK handles session management, country and ID-type selection, document capture, identity verification, and liveness detection automatically.Features
- Drop-in SwiftUI view —
SmartComplyFlowViewmanages the entire verification flow with no UI code required - Two verification modes — document photo capture or ID number data entry, configured from your Dashboard
- Guide-box document capture — crops exactly what falls inside the ID card frame so the image sent to the backend is always clean
- Liveness detection — a passive face scan (blink plus natural head movement) runs automatically after identity verification, with no step-by-step prompts
- Dynamic ID types — channels and fields are fetched live from your Dashboard configuration
- Multi-country support — renders a country picker automatically when more than one country is configured
- Dark and light mode — theme adapts to the system colour scheme; override with
preferredColorScheme - Automatic upload retry — transient upload failures are retried internally
Requirements
- iOS 16.0 or later
- Swift 5.9 or later
- Xcode 15 or later
- A physical device that supports ARKit face tracking. Liveness gates on
ARFaceTrackingConfiguration.isSupported, which covers iPhone X and later as well as A12 and later devices without a TrueDepth camera. Liveness cannot run in the Simulator
Installation
The SDK is distributed via Swift Package Manager as a precompiled XCFramework. The package you add contains the Swift Package manifest; Xcode downloads the binary automatically and embeds it in your app.Xcode (recommended)
- Open your project in Xcode
- Go to File → Add Package Dependencies
- Enter the repository URL:
https://github.com/386konsult/smartcomply-ios-sdk - Select Up to Next Major Version and enter
1.0.2 - Click Add Package and select the SmartComplySDK library
Package.swift
The package URL is
smartcomply-ios-sdk, which is not the same as the SDK’s source repository.
It ships both device and simulator slices, so the same dependency builds for a physical device
and the Simulator without extra configuration.Platform Setup
Add the following key to your app’sInfo.plist:
PHPickerViewController, which runs out of process and requires no photo-library key.
Credentials
Both values come from your Adhere Dashboard and both are permanent. Reuse the same pair for every verification.Quick Start
1. Create the SDK instance
Create aSmartComply instance once, for example in your view model or app entry point.
2. Present the flow view
EmbedSmartComplyFlowView anywhere in your SwiftUI hierarchy. The SDK loads automatically when the view appears.
- Creates a secure session
- Displays a welcome screen with your brand name and ID type cards
- Shows a country picker if multiple countries are configured
- User photographs the front of their ID inside the guide box
- Photographs the back if the ID type’s name contains national, driver, resident or voter
- Runs the passive liveness scan
- Returns a
FlowResultto your completion handler
- Creates a secure session
- Displays a welcome screen with ID type selection
- Shows a country picker if multiple countries are configured
- User enters their ID number and any required fields
- Identity is verified against the national database
- Runs the passive liveness scan
- Returns a
FlowResultto your completion handler
Environments
.sandbox targets a server running on the device itself, for local backend development. It is not a hosted test environment. Use .production for all integration work.
SDK Configuration
FlowResult
Delivered to youronComplete closure when the user completes the flow in-app.
From 1.0.2 both are populated. In document verification they come from the OCR of the captured
document; in data verification they come from the identity provider’s response.
verifiedName is
the full name where the provider sends one, otherwise it is composed from the first, middle and
last name fields.They are still only as good as the submission that produced them, so treat them as a receipt of
what was read, not as a verdict. The webhook remains the source of truth for the final outcome.The result is a submission receipt, not a verification verdict.
status is "processing" when the user finishes: face matching, document OCR and the government database check all continue after onComplete fires. An entry’s status moves through pending, processing, and then passed, failed or expired. The final status, the extracted fields and any failure reason are delivered to the webhook URL configured on your SDK Config. See Webhooks for the full payload.Error Handling
SmartComplyFlowView handles and displays error states automatically. For the headless API, all SDK methods throw on failure:
SDKError exposes message: String, statusCode: Int and errorCode: String?. AuthError and NetworkError both subclass it, so a single catch let error as SDKError covers every case.

