Skip to content

iOS (Swift)

Requirements: iOS 13.0+, Xcode 15.3+.

Install via Swift Package Manager — File → Add Package Dependencies, repo URL: https://github.com/socure-inc/socure-sigmadevice-sdk-ios.

Initialize:

import DeviceRisk

let options = SigmaDeviceOptions()
options.omitLocationData = false

SigmaDevice.initializeSDK("YOUR_SDK_KEY", options: options) { result, error in
    if let error = error { print("SDK init error: \(error)"); return }
    // SDK initialized successfully
}

Generate a token and run SNA — do both before your Prefill request:

Task {
    do {
        let diSessionToken = try await SigmaDevice.getSessionToken()
        // performSilentNetworkAuth is the call that actually runs SNA. Mobile
        // number in E.164 format; await it so the result is ready for decisioning.
        try? await SigmaDevice.performSilentNetworkAuth(mobileNumber: "+15551234567")
        // ...include diSessionToken on your Prefill request
    } catch {
        // Proceed without token — the user falls back to OTP verification
    }
}