Skip to main content
This page covers the SNA-only integration of the OTPless Headless SDK on iOS. The SDK accepts the requestId generated by the Create API, performs the silent network handshake, and reports progress through callbacks. Your backend confirms the final result via the Status Check API.

Requirements

Step 1: Add SDK dependency

The SDK can be installed via CocoaPods or Swift Package Manager. Find the latest version of the SDK here.
For CocoaPods, run the following in your root folder to fetch the dependency:

Step 2: Configure Info.plist for SNA

Add the following block to your Info.plist only if you are using the SNA feature.
  • If the NSAppTransportSecurity key is not already present, add the entire block below.
  • If the NSAppTransportSecurity key is already present, add the listed domains one by one under NSExceptionDomains.
Info.plist
Make sure Silent Network Authentication is enabled on the OTPLESS dashboard. For an SNA-only configuration, SNA must be the only channel enabled. Learn more about Silent Network Authentication.

Step 3: Start SNA with the requestId

Pass the requestId returned by the Create API to start():
Start polling the Status Check API from your backend immediately after calling start(). The SDK callback and the server status run in parallel.

Step 4: Handle callbacks

Callback reference

The SDK works in two steps — initialization and start() — and each step has its own set of callbacks.

Step 1: Initialization callbacks

Emitted when the SDK initializes.

Step 2: Start callbacks

Emitted after you invoke start() to begin authentication.
For the errorCode / statusCode values surfaced in SDK callbacks, see SDK Error Codes.

Next step

Status Check API

Confirm the authoritative auth status from your server.