iOS SDK
The Kora IDV iOS SDK provides a complete verification UI — document capture, selfie, and liveness detection — built with UIKit and SwiftUI support.
Requirements
- iOS 14.0+
- Xcode 14.0+
- Swift 5.7+
Installation
CocoaPods
# Podfile
pod 'KoraIDV', '~> 1.1.0'
pod install
Swift Package Manager
Add the package in Xcode:
- File → Add Package Dependencies
- Enter the repository URL:
https://github.com/korastratum/koraidv-ios - Select version
1.1.0or later
Or add to your Package.swift:
dependencies: [
.package(url: "https://github.com/korastratum/koraidv-ios", from: "1.1.0")
]
Quick start
1. Configure the SDK
import KoraIDV
// In your AppDelegate or app initialization
KoraIDV.configure(
apiKey: "test_your_api_key",
tenantId: "your-tenant-uuid",
environment: .sandbox
)
2. Start a verification
// Create verification on your server first, then launch with the ID
KoraIDV.startVerification(
verificationId: "ver_abc123", // From your server
presenting: self,
documentTypes: [.usPassport, .usDriversLicense],
livenessMode: .active
) { result in
switch result {
case .success(let verification):
let status = verification.status
let score = verification.overallScore
let imagePersisted = verification.imagePersisted
// Handle success
case .failure(let error):
// Handle error
print(error.message)
}
}
Resume an existing verification
KoraIDV.resumeVerification(
verificationId: existingVerificationId,
presenting: self
) { result in
// Handle result
}
Configuration options
| Parameter | Type | Default | Description |
|---|---|---|---|
apiKey | String | Required | Your API key (test_ for sandbox, live_ for production) |
tenantId | String | Required | Your tenant UUID |
environment | APIEnvironment | .sandbox | .sandbox or .production |
baseURL | String? | nil | Override base URL (for on-premise deployments) |
documentTypes | [DocumentType] | All types | Restrict which document types are accepted |
livenessMode | LivenessMode | .active | .active (challenges) or .passive (auto-detect) |
theme | KoraTheme? | nil | Custom theme colors and styling |
timeout | TimeInterval | 300 | Session timeout in seconds |
Theme customization
let theme = KoraTheme(
primaryColor: UIColor.systemBlue,
backgroundColor: UIColor.systemBackground,
textColor: UIColor.label,
errorColor: UIColor.systemRed,
cornerRadius: 12,
buttonHeight: 48
)
KoraIDV.configure(
apiKey: "test_your_api_key",
tenantId: "your-tenant-uuid",
theme: theme
)
Error handling
case .failure(let error):
switch error.code {
case .networkError:
// Check internet connection
showRetryAlert(message: error.message)
case .cameraAccessDenied:
// Prompt user to enable camera in Settings
openSettings()
case .sessionExpired:
// Create a new verification on your server
createNewVerification()
case .userCancelled:
// User dismissed the verification
break
}
| Error Code | Description | Recovery |
|---|---|---|
.networkError | Network request failed | Check connection, retry |
.cameraAccessDenied | Camera permission not granted | Open Settings, request permission |
.sessionExpired | Verification session timed out | Create a new verification |
.userCancelled | User dismissed the UI | Prompt to try again |
Privacy permissions
Add to your Info.plist:
<key>NSCameraUsageDescription</key>
<string>Camera access is required to capture your identity document and selfie for verification.</string>
Troubleshooting
Environment naming conflict
If you have another Environment type in your project, use the fully qualified name:
KoraIDV.configure(
apiKey: "test_your_api_key",
tenantId: "your-tenant-uuid",
environment: KoraIDV.APIEnvironment.sandbox
)
Deployment target mismatch
Ensure your project's minimum deployment target is iOS 14.0 or higher. In Xcode: Project → General → Minimum Deployments.
CocoaPods cache issues
pod cache clean KoraIDV --all
pod deintegrate
pod install
Flutter bridge
If your iOS host is part of a Flutter app:
// In your AppDelegate
let controller = window?.rootViewController as! FlutterViewController
let channel = FlutterMethodChannel(
name: "com.yourapp/koraidv",
binaryMessenger: controller.binaryMessenger
)
channel.setMethodCallHandler { call, result in
if call.method == "startVerification" {
let args = call.arguments as! [String: Any]
let verificationId = args["verificationId"] as! String
KoraIDV.startVerification(
verificationId: verificationId,
presenting: controller
) { verificationResult in
switch verificationResult {
case .success(let v):
result(["status": v.status, "score": v.overallScore])
case .failure(let error):
result(FlutterError(
code: "VERIFICATION_ERROR",
message: error.message,
details: nil
))
}
}
}
}