iOS

The iOS SDK NeuroVisionKyc (Swift, SwiftUI) runs the session in its own full-screen controller or SwiftUI view and returns the result to a closure.

Requirements

iOS
Xcode
Installation

Installation

Until the SDK is published, it comes as a local Swift package in the SDK package (sdk/ios/NeuroVisionKyc/ — the folder with Package.swift and Frameworks/). Copy it into your project, then in Xcode: File → Add Package Dependencies… → Add Local…, pick that folder, and add the NeuroVisionKyc library to your app target.

With XcodeGen:

packages:
  NeuroVisionKyc:
    path: third_party/NeuroVisionKyc
targets:
  App:
    dependencies:
      - package: NeuroVisionKyc

The framework is a binary for devices (arm64) and the simulator (arm64, x86_64). Once the SDK is published, the local package is replaced by the package's URL and nothing else changes.

The app's Info.plist needs the camera usage text — without it iOS ends the app at the first use of the camera:

<key>NSCameraUsageDescription</key>
<string>The camera photographs your document and films the liveness check.</string>

Usage

UIKit:

import NeuroVisionKyc

let request = KycRequest(apiHost: apiHost, schemaId: schemaId, clientKey: clientKey)
// or KycRequest(apiHost: apiHost, identity: .task(taskId: taskId)) for a task the server created
let screen = NeuroVisionKyc.makeViewController(request: request) { result in
    controller.dismiss(animated: true)
    switch result {
    case .completed(let verdict): print(verdict)         // success, failed, suspicious, expired, unknown
    case .cancelled: break                                // the user left before the end
    case .failed(let reason, let message): print(reason, message ?? "")
    @unknown default: break
    }
}
controller.present(screen, animated: true)

SwiftUI:

.fullScreenCover(isPresented: $running) {
    NeuroVisionKycView(request: request) { result in
        running = false
        // handle result
    }
}

NeuroVisionKycView opens the session when it first appears, and ends it as .cancelled if the app removes the view before the end of the session.

What each result means and what to show the user — Results. Where apiHost, schemaId, clientKey and taskId come from — Server integration.

API

DeclarationWhat
NeuroVisionKyc.makeViewController(request:onResult:)A full-screen UIViewController that runs a session; present it yourself
NeuroVisionKycView(request:onResult:)The same session as a SwiftUI view
NeuroVisionKyc.versionThe SDK’s version
KycRequest(apiHost:schemaId:clientKey:clientUser:language:theme:)A session for a scenario and the key your server minted
KycRequest(apiHost:identity:clientUser:language:theme:)A session for an identity: .schema(schemaId:clientKey:) or .task(taskId:)
apiHostA URL
clientUserOptional. The user’s ID in your system, up to 36 characters, in plain text. The same value in all attempts of one person groups them; do not pass personal data. See Working with clientKey
languageThe interface language, ISO 639-1 ("en", "ru", …; "zh-CN" for Simplified Chinese). nil: the scenario’s language, else the device’s. A language the scenario does not offer is ignored
theme.auto (the scenario’s choice, else the device’s), .light, .dark
KycResult.completed(KycVerdict), .cancelled, .failed(KycFailure, message: String?)

A printed KycIdentity or KycRequest leaves the client key out, so logging a request does not log the key.

Things to know

  • onResult is called once, on the main queue; dismissing the controller is up to you. A controller dismissed before the end of the session ends it as .cancelled.
  • The SDK's enums are not frozen: a newer version may add a case, so a switch over them needs @unknown default.
  • One session at a time. A second session while the first one runs ends at once as .failed(.config, "a KYC session is already running").
  • The session's screen is full-screen and portrait.
  • apiHost must be https; plain http is accepted only for the device itself (localhost).
  • The SDK runs on the simulator too, but the simulator has no camera: run sessions on a device.
  • iOS 15 – 16.3. The session works, with small layout differences: the bottom sheets take the full height, the accepted documents stand one per row, and the home indicator stays visible during the liveness check.

Analytics (optional)

The SDK can send product analytics to the PostHog project your app names in its Info.plist; the SDK itself carries no key:

<key>NeuroVisionKycPostHogKey</key>
<string>phc_…</string>
<key>NeuroVisionKycPostHogHost</key>
<string>https://us.i.posthog.com</string>

Without a key the SDK sends no analytics. Keep the key out of git: $(KYC_POSTHOG_KEY) in Info.plist, with the value from an .xcconfig that is kept out of git. What is sent — Analytics and privacy.

Privacy

The framework carries its own privacy manifest (PrivacyInfo.xcprivacy): Xcode merges it into your app's privacy report (Product → Archive → Generate Privacy Report), from which you fill in the App Store privacy label. The session sends the NeuroVision server the document photo, the liveness check photos and video, and the device's facts with its simulator and tampering signals, for fraud prevention — see Analytics and privacy.