Skip to main content
The SDK requires iOS 15.0+ at runtime (deployment target 13.0+). Calls are guarded with @available(iOS 15.0, *) and are no-ops below iOS 15.

Prerequisites

  • iOS 15.0 or higher at runtime
  • App ID, Client ID, and Client Secret from the OTPless dashboard
  • Swift 5.5–6.0, Xcode 14+

Installation

Swift Package Manager Add the package URL in Xcode → File → Add Package Dependencies…, or in your Package.swift:
Dependency rule: Up to Next Major Version from 1.2.0. CocoaPods
Podfile
Run pod install and open the generated .xcworkspace. OtplessEventIO is resolved transitively — no manual step.

Add permissions

In your Info.plist, add the optional permissions:
Info.plist
Optional entitlements that improve signal accuracy (Signing & Capabilities → + Capability):
  • Access WiFi Information — network identity signals.
  • iCloud → CloudKit — cross-device identity signals.
The SDK never requests location itself. If geo signals matter, prompt the user before your first fetchIntelligence:

Initialize the SDK

Call initialize once, as early as possible — in your AppDelegate or SwiftUI @main init(). Pass your App ID:
AppDelegate.swift
isInitialized: Bool reflects whether initialize has completed successfully.

Integrate with OtplessBM SDK

If you already use OtplessBM, you do not call fetchIntelligence yourself — set deviceFingerprintMode on the request and OtplessBM handles the fetch via runtime lookup. You still install OTPlessIntelligence and call initialize(appId:) at launch.

DeviceFingerprintMode values

If OTPlessIntelligence is not linked or not initialized, OtplessBM logs a warning and the auth flow proceeds without a dfrId — failures never block auth.

Fetch device intelligence

fetchIntelligence returns an IntelligenceApiResponse containing dfrId. Call it from a Task (async form) or via the ObjC-bridged callback.
Callback form (Swift or Objective-C):
Retries: the engine call and backend push both use exponential backoff — 500 ms base, max 4 attempts. A response missing dfrId is treated as a failure and retried.

Pass additional context (optional)

Pass params and/or updateInfo to attach extra context and enable more accurate risk scoring.
In the callback / Objective-C form, updateInfo is a dictionary; enum fields expect raw-value strings ("MANUAL", "COPY_PASTED", "LOGIN", …). Unknown keys and invalid enum strings are silently dropped.

UpdateInfo fields

params is a per-call pass-through — every non-reserved entry is forwarded into the push body verbatim. Reserved keys (silently dropped): data, status, requestId, message, plus SDK-set tsId, inId, platform, appId.

Get the detailed report (server-side)

After receiving dfrId, your backend exchanges it for the full report. Never call this from the app — it requires CLIENT_SECRET.

Sample response

Success

Error

Response fields

Error reference

Intelligence signals are advisory — always degrade gracefully on failure. Log requestId for support.

Troubleshooting

  • initialize returns false — check [OTPless] logs in debug builds. Common causes: invalid App ID (401), App ID not found (404), no internet, or credentials rejected by IdentityFraud.
  • fetchIntelligence returns .notConfigured — you called it before initialize completed. Wait for the completion callback with success == true.
  • No such module 'OTPlessIntelligence' — CocoaPods: open .xcworkspace, re-run pod install. SPM: File → Packages → Resolve Package Versions. Then Clean Build Folder (⇧⌘K).
  • With OtplessBM, dfrId never arrives — confirm OTPlessIntelligence is linked and initialize(appId:) runs before any OtplessBM request with mode .SYNC / .ASYNC. Look for OTPLESS: OTPlessIntelligence not linked. in the device log.
  • UI crash after fetchIntelligence — completions fire on a background thread; wrap UI updates in DispatchQueue.main.async.
  • Simulator — some signals (GPS, IP, hardware attestation) are unavailable or mocked. Validate on a real device before release.