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 yourPackage.swift:
1.2.0.
CocoaPods
Podfile
pod install and open the generated .xcworkspace. OtplessEventIO is resolved transitively — no manual step.
Add permissions
In yourInfo.plist, add the optional permissions:
Info.plist
- Access WiFi Information — network identity signals.
- iCloud → CloudKit — cross-device identity signals.
fetchIntelligence:
Initialize the SDK
Callinitialize 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 useOtplessBM, 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.
dfrId is treated as a failure and retried.
Pass additional context (optional)
Passparams and/or updateInfo to attach extra context and enable more accurate risk scoring.
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 receivingdfrId, 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
initializereturnsfalse— check[OTPless]logs in debug builds. Common causes: invalid App ID (401), App ID not found (404), no internet, or credentials rejected byIdentityFraud.fetchIntelligencereturns.notConfigured— you called it beforeinitializecompleted. Wait for the completion callback withsuccess == true.No such module 'OTPlessIntelligence'— CocoaPods: open.xcworkspace, re-runpod install. SPM: File → Packages → Resolve Package Versions. Then Clean Build Folder (⇧⌘K).- With
OtplessBM,dfrIdnever arrives — confirmOTPlessIntelligenceis linked andinitialize(appId:)runs before anyOtplessBMrequest with mode.SYNC/.ASYNC. Look forOTPLESS: OTPlessIntelligence not linked.in the device log. - UI crash after
fetchIntelligence— completions fire on a background thread; wrap UI updates inDispatchQueue.main.async. - Simulator — some signals (GPS, IP, hardware attestation) are unavailable or mocked. Validate on a real device before release.