Skip to content

Installation

Using Zip files

Short integrator-oriented guide to add VeridasDocumentSDK to an iOS project.

1) Download the zipped xcframework files (VeridasCommonDefinitions, VeridasCommonUtils, VeridasDocumentSDK, 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 DocumentCaptureConfiguration instance (it is Codable, so you can build it in code or load it from a JSON such as documentCapture.json in SdkJsonConfigs/).
  • Ensure camera permission in Info.plist: NSCameraUsageDescription.
  • iPad only — add UIRequiresFullScreen to Info.plist to 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 VeridasDocumentSDK

final class MyController: UIViewController, DocumentCaptureDelegate, DocumentCaptureEventsDelegate {
    func startDocumentCapture() {
        // Decode from JSON (recommended). You can also build it in code.
        let config = loadConfigFromJSON("documentCapture", as: DocumentCaptureConfiguration.self)
        DocumentCapture.setEventsDelegate(delegate: self)
        DocumentCapture.start(delegate: self, configuration: config)
    }

    // DocumentCaptureDelegate
    func onDocumentCaptureResults(results: DocumentCaptureResults) { print(results) }
    func onDocumentCaptureStarted() { print("SDK started") }
    func onDocumentCaptureFinished(error: DocumentCaptureError?) { print(error as Any) }

    // DocumentCaptureEventsDelegate
    func onDocumentCaptureEvent(event: DocumentCaptureEvent) { 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 startDocumentCapture() {
    let config = loadConfigFromJSON("documentCapture", as: DocumentCaptureConfiguration.self)
    DocumentCapture.setEventsDelegate(delegate: self)
    DocumentCapture.start(delegate: self, configuration: config)
}

DocumentCaptureDelegate covers onDocumentCaptureResults, onDocumentCaptureStarted, and onDocumentCaptureFinished, while DocumentCaptureEventsDelegate can be implemented optionally to receive tracking events through onDocumentCaptureEvent. Details are in the API section.