Installation¶
Using Zip files¶
Short integrator-oriented guide to add VeridasSelfieSDK to an iOS project.
1) Download the zipped xcframework files (VeridasCommonDefinitions, VeridasCommonUtils, VeridasSelfieSDK, VeridasGenuineDS, VeridasNativeDS, VeridasSDKCore), place them inside an xcframeworks/ folder in your Xcode project, add them to the target, and set each one to Embed & Sign in the target’s General settings.
Project settings (UIKit)¶
If the app is UIKit-based, disable User Script Sandboxing in Build Settings.
Prepare the configuration¶
- Provide a
SelfieCaptureConfigurationinstance (it isCodable, so you can build it in code or load it from a JSON such asselfieCapture.jsoninSdkJsonConfigs/). - Ensure camera permission in
Info.plist:NSCameraUsageDescription. - iPad only — add
UIRequiresFullScreentoInfo.plistto ensure the SDK can control the screen orientation.
Minimal code usage¶
Import the SDK, create the configuration (programmatically or from JSON), and start the flow:
import UIKit
import VeridasSelfieSDK
final class MyController: UIViewController, SelfieCaptureDelegate, SelfieCaptureEventsDelegate {
func startSelfieCapture() {
// Decode from JSON (recommended). You can also build it in code.
let config = loadConfigFromJSON("selfieCapture", as: SelfieCaptureConfiguration.self)
SelfieCapture.setEventsDelegate(delegate: self)
SelfieCapture.start(delegate: self, configuration: config)
}
// SelfieCaptureDelegate
func onSelfieCaptureResults(results: SelfieCaptureResults) { print(results) }
func onSelfieCaptureStarted() { print("SDK started") }
func onChallengeTokenRequired() { print("Challenge token required") }
func onSelfieCaptureFinished(error: SelfieCaptureError?) { print(error as Any) }
// SelfieCaptureEventsDelegate
func onSelfieCaptureEvent(event: SelfieCaptureEvent) { print(event) }
}
Optional helper to load JSON from the bundle instead of building the config inline:
private func loadConfigFromJSON<T: Decodable>(_ name: String, as type: T.Type) -> T {
guard let url = Bundle.main.url(forResource: name, withExtension: "json") else {
fatalError("Missing \(name).json in app bundle")
}
let data = try! Data(contentsOf: url)
return try! JSONDecoder().decode(T.self, from: data)
}
Example using loadConfigFromJSON inside your controller:
func startSelfieCapture() {
let config = loadConfigFromJSON("selfieCapture", as: SelfieCaptureConfiguration.self)
SelfieCapture.setEventsDelegate(delegate: self)
SelfieCapture.start(delegate: self, configuration: config)
}
SelfieCaptureDelegate covers onSelfieCaptureResults, onSelfieCaptureStarted, onChallengeTokenRequired and onSelfieCaptureFinished, while SelfieCaptureEventsDelegate implements onSelfieCaptureEvent to receive everything happening in the SDK. Details are in the API section.