Skip to main content

iOS SDK

Didit iOS SDK for identity verification

Native Swift screens for document capture, liveness and NFC. Add one package and call one method.

https://github.com/didit-protocol/sdk-ios.git

Install

Install

Use Swift Package Manager or CocoaPods.

// Package.swiftdependencies: [    .package(url: "https://github.com/didit-protocol/sdk-ios.git", from: "4.15.4")]// Add exactly one product to your target.product(name: "DiditSDK", package: "DiditSDK")

Pick exactly one variant

VariantSwift package productCocoaPodsNFCMinimum iOS
All Default
DiditSDK
DiditSDK/All
Yes
iOS 15.0
Core Smallest
DiditSDKCore
DiditSDK/Core
No
iOS 13.0
NFC
DiditSDKNFC
DiditSDK/NFC
Yes
iOS 15.0

NFC means reading the chip in a passport or ID card with the phone. Every variant captures the document and the selfie automatically. Your code always writes import DiditSDK. The pod is a binary podspec in the repo, not on the public CocoaPods Trunk.

Start

Start a verification

Pass the session token from your server and handle three results.

Three results

.completedThe user finished. session.status is .approved, .pending or .declined.
.cancelledThe user closed the flow.
.failedSomething went wrong. Show error.localizedDescription.

The SDK returns the status only. .pending means In Review. The full decision reaches your server by webhook.

SwiftUI
import SwiftUIimport DiditSDKstruct ContentView: View {    var body: some View {        Button("Verify Identity") {            DiditSdk.shared.startVerification(                token: "session-token-from-backend"            )        }        .diditVerification { result in            switch result {            case .completed(let session):                if session.status == .approved { /* grant access */ }            case .cancelled:                break            case .failed(let error, _):                print(error.localizedDescription)            }        }    }}

Requirements

What you need

Six things to check before you ship.

iOS 15.0 for the default packageThe Core variant runs on iOS 13.0. NFC chip reading needs iOS 15.0 and a phone with NFC.
Xcode 15.0, Swift 5.9Latest SDK version 4.15.4.
SwiftUI and UIKitOne call starts the flow in either one.
Info.plist keysNSCameraUsageDescription, NSMicrophoneUsageDescription and NSPhotoLibraryUsageDescription.
NFC setupNFCReaderUsageDescription, the NFC tag reading capability and the ISO7816 identifiers.
54 languagesThe SDK uses the device language, with English as the fallback.

Questions

Questions about the iOS SDK

Should I use the native iOS SDK or a WebView?
Use the native SDK. It reads NFC chips, tunes the camera for the ID and the selfie and feels like the rest of your app. A WebView is a fallback only.
Does the iOS SDK read NFC chips?
Yes, with the All or the NFC variant, on iOS 15.0 and later and a phone with NFC. Add the NFC tag reading capability and the ISO7816 identifiers to your app.
Does my API key go in the app?
No. The key stays on your server. Your server creates the session and the app only gets the session token.
Does the SDK return the full result?
No. It returns the status. The full decision, with the document fields and the scores, reaches your server by webhook.
How do I install the Didit iOS SDK?
With Swift Package Manager, the recommended option, add https://github.com/didit-protocol/sdk-ios.git from 4.15.4 and pick exactly one library product. With CocoaPods, reference the podspec URL, because DiditSDK is not on the public Trunk, then open the generated .xcworkspace. You can also drag the per-variant XCFrameworks from GitHub Releases and set Embed and Sign. It needs Xcode 15.0 and Swift 5.9 or later.
Which iOS SDK variant should I install?
Pick exactly one. Core is the smallest, with automatic capture and no NFC, on iOS 13.0 and later. NFC adds passport and eID chip reading, and All, the default, has every feature; both need iOS 15.0 and bundle OpenSSL 3.3.3. AutoDetection is deprecated since 4.11.0 and identical to Core. import DiditSDK is the same for every variant.
Which Info.plist keys does the iOS SDK need?
Add NSCameraUsageDescription, NSMicrophoneUsageDescription and NSPhotoLibraryUsageDescription, which are required. Add NFCReaderUsageDescription when you use the NFC or All variant, and NSLocationWhenInUseUsageDescription optionally for fraud prevention geolocation. Didit uses the camera for document scanning and face verification and the microphone for liveness video.
Will Apple ask for anything during App Store review?
If you install the NFC or All variant, Apple's App Review may ask for a video of the NFC flow because NFC code is part of the SDK binary, even if your workflow does not use NFC. Didit's support team (support@didit.me) can send you an NFC walkthrough video to share with Apple. This does not apply to the Core or AutoDetection variant.
Can I test NFC reading in the iOS Simulator?
No. The NFC and All variants link CoreNFC, and since Xcode 12 the library it needs is missing from simulators, so test NFC features on physical devices only. The Core and AutoDetection variants do not have this limitation.
How do I close the verification from my app?
Call DiditSdk.shared.dismiss(), available in DiditSDK 3.6.0 and later, for example when the app moves to the background. It dismisses the UI, resets state and calls your .diditVerification handler with .cancelled carrying the current sessionId. Do not set isPresented to false or call UIKit's dismiss(animated:): neither fires your handler.
Which iOS SDK version supports biometric consent?
iOS SDK 4.10.0 and later can show the biometric consent step that Didit asks for, before the first face capture, for people covered by Illinois, Texas or Colorado law. Earlier versions still run sessions, but the decision reports the consent as not collected with the reason BIOMETRIC_CONSENT_UNSUPPORTED_SDK. Upgrade if you verify people in those states.

Compliance built in

Audited, certified and attested.

We hold the certifications and build each country's rules into your flows, so you can launch anywhere without worrying. Security and Compliance center

  • Regulation encoded into your flows

    Tell us what you do and where. Didit lists the rules that apply to you, with sources, and builds the checks each country needs into one workflow.

  • Ready for AMLR

    Every requirement of the new EU anti-money laundering rules, from checking customers to human review, is already covered by a Didit check.

  • Trusted by EU regulators

    After a year of supervised testing, EU financial regulators confirmed that verifying with Didit is safer than checking an ID in person.

  • Audited, not self-declared

    iBeta Level 1 and Level 2. Liveness tested under ISO/IEC 30107-3.

Compliance assistant

Your obligations · 3 regions

EU · AMLRCustomer due diligence, human reviewCovered
Illinois, Texas, ColoradoExplicit biometric consentCovered
Germany · Youth protectionVerified adults only (JMStV)Covered
Workflow checked. Every obligation is met
  • SOC 2 Type 2
  • ISO 27001
  • iBeta Level 1 and Level 2
  • EU regulator attestation
  • FSM youth protection
  • GDPR
  • EBA remote onboarding
  • MiCA compatible
  • FIDO Alliance member
  • AMLREU AML Regulation ready

Integration · Didit MCP

Run Didit from your own AI agent

Connect Didit to Claude, Cursor, VS Code or ChatGPT and just ask in plain words. Your agent can do anything you can do in the console, with the same permissions you have.

Add to ClaudeChatGPT
Didit Academy · Lesson 04 · Use Didit with MCP
  • Build workflowsDescribe the checks you need. The agent creates and publishes the flow.
  • Run investigationsAsk why a session was declined, review cases, search people and companies.
  • Change rulesCreate payment rules, test them on past data and switch them on.
  • Pull reportsAsk for numbers, exports or the audit log.

Start

Add the package

Create an account, get your sandbox key and add the package in Xcode.

Create accountRead the docs

Free sandbox. Credit applies to work-email sign-ups.