Native SDK: This is the recommended approach for iOS apps. Native SDKs provide the best user experience, optimized camera handling, and full NFC support.
When installing via CocoaPods on apps targeting iOS 13/14, you may see a warning about NFCPassportReader requiring iOS 14+. This warning can be safely ignored — the SDK will work correctly, and NFC functionality is automatically disabled on older iOS versions.
<key>NSCameraUsageDescription</key><string>Camera access is required to scan your identity documents for verification.</string><key>NSMicrophoneUsageDescription</key><string>Microphone access is required to record video for liveness verification.</string><key>NSPhotoLibraryUsageDescription</key><string>Photo library access is required to upload document images.</string><key>NFCReaderUsageDescription</key><string>NFC access is required to read the chip in your identity document.</string><key>NSLocationWhenInUseUsageDescription</key><string>Location access helps verify your identity and prevent fraud.</string>
Simulator Limitation: The iOS SDK requires CoreNFC, which is not fully available on simulators. Since Xcode 12, libnfshared.dylib is missing from simulators. Test NFC features on physical devices only.
App Store Review: Even if you disable NFC in your workflow, Apple may request a demo video because NFC code is part of the SDK binary. You can download our NFC demo video to submit to Apple: Download NFC Demo Video
// Your backend creates a session and returns the tokenlet sessionToken = await yourBackend.createVerificationSession(userId: currentUser.id)// Pass the token to the SDKDiditSdk.shared.startVerification(token: sessionToken)
This approach gives you full control over:
Associating sessions with your users (vendor_data)
let config = DiditSdk.Configuration( fontFamily: "Avenir-Medium", // Custom font (must be registered in your app) loggingEnabled: false, // Enable debug logging languageLocale: .english // Force specific language)DiditSdk.shared.startVerification( token: "your-session-token", configuration: config)
Custom font family name (must be registered in your app)
loggingEnabled
Bool
false
Enable SDK debug logging
languageLocale
SupportedLanguage?
Device locale
Force specific language
Theming & Colors: Colors, backgrounds, and intro screen settings are configured through your White Label settings in the Didit Console, not in the SDK configuration. This ensures consistent branding across all platforms.
.diditVerification { result in switch result { case .completed(let session): switch session.status { case .approved: print("✅ Approved! Session: \(session.sessionId)") // User is verified - grant access case .pending: print("⏳ Under review. Session: \(session.sessionId)") // Show "verification in progress" UI case .declined: print("❌ Declined. Session: \(session.sessionId)") // Handle declined verification } case .cancelled(let session): if let session = session { print("🚫 Cancelled session: \(session.sessionId)") } // User chose to cancel - maybe show retry option case .failed(let error, let session): print("⚠️ Error: \(error.localizedDescription)") // Handle error - show retry or contact support }}
You can observe the SDK state for custom loading UI:
Copy
struct CustomView: View { @ObservedObject private var sdk = DiditSdk.shared var body: some View { VStack { switch sdk.state { case .idle: Text("Ready to verify") case .creatingSession: ProgressView("Creating session...") case .loading: ProgressView("Loading...") case .ready: Text("Verification in progress") case .error(let message): Text("Error: \(message)") } } }}