Skip to main content

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 viewSmartComplyFlowView manages 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 — face challenge system (blink, turn head) runs automatically after identity verification
  • 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 retry — handles upload retries and session errors internally

Requirements

  • iOS 16.0 or later
  • Swift 5.9 or later
  • Xcode 15 or later
  • iPhone X or later — liveness detection requires a front-facing TrueDepth camera

Installation

The SDK is distributed via Swift Package Manager.
  1. Open your project in Xcode
  2. Go to File → Add Package Dependencies
  3. Enter the repository URL: https://github.com/386konsult/ios-sdk
  4. Select Exact Version and enter 1.0.0
  5. Click Add Package and select the SmartComplySDK library

Package.swift


Platform Setup

Add the following key to your app’s Info.plist:

Quick Start

1. Create the SDK instance

Create a SmartComply instance once — for example in your view model or app entry point. Generate a fresh clientId (UUID) for each new verification attempt.

2. Present the flow view

Embed SmartComplyFlowView anywhere in your SwiftUI hierarchy. The SDK loads automatically when the view appears.
The SDK manages the entire flow automatically. The exact steps depend on the verification mode configured in your Dashboard: Document mode (photo capture):
  1. Creates a secure session
  2. Displays a welcome screen with your brand name and ID type cards
  3. Shows a country picker if multiple countries are configured
  4. User photographs the front of their ID inside the guide box
  5. Photographs the back if required (National ID, Driver’s Licence, Voter’s Card)
  6. Runs liveness face challenges
  7. Returns a FlowResult to your completion handler
Data mode (ID number entry):
  1. Creates a secure session
  2. Displays a welcome screen with ID type selection
  3. Shows a country picker if multiple countries are configured
  4. User enters their ID number and any required fields
  5. Identity is verified against the national database
  6. Runs liveness face challenges
  7. Returns a FlowResult to your completion handler

SDK Configuration


FlowResult

Delivered to your onComplete closure when the user completes the flow in-app.
Final verification results are delivered via webhook. Once the backend completes processing, SmartComply sends a webhook event to the URL configured in your Dashboard. Set up your webhook endpoint to receive the final status, extracted fields, and any failure reasons. See the Webhooks guide for the full payload reference.

Error Handling

SmartComplyFlowView handles and displays error states automatically. For the headless API, all SDK methods throw on failure: