> For the complete documentation index, see [llms.txt](https://docs.idlayr.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.idlayr.com/products/number-verification/discovery/integration/ios.md).

# iOS

{% hint style="info" %}
**Device API** · NV 1.0 · Early Access
{% endhint %}

The iOS SDK is `IDlayrKit` — the same package used for Secure SNA. For Discovery, the SDK pins the request to the cellular interface, follows the verification URL's redirect chain, and hands the resulting `code` back to your app. Your app then passes the code to your backend, which submits it to IDlayr and receives the discovered MSISDN in the response.

This page covers the device-side integration. For the backend role, see [Backend integration](/products/number-verification/discovery/integration/backend.md).

## 1. Install the SDK

Same SDK as Secure SNA — see the iOS SDK installation page.

## 2. Obtain a verification URL

Your backend creates a Discovery check and receives a `check_id` and a verification `url`. **Your backend hands only the `url` to your iOS app**, over your own application API. The OAuth2 access token never leaves your backend; the SDK doesn't need it. See [Backend integration](/products/number-verification/discovery/integration/backend.md#2-create-the-check).

## 3. Drive the verification

Use the SDK's Discovery method to drive the cellular-pinned request. The SDK follows the URL's redirect chain (plain HTTP, no `Authorization` header required) and hands the resulting `code` back to your app via a completion callback.

```swift
import IDlayrKit

// SDK API for Discovery — exact method signature TBD.
// Conceptually: pass the discovery URL, and receive a completion
// callback carrying the outcome — a JSON object with the `code` and
// status on success, or an error on failure. The MSISDN is not in the
// SDK's response; only your backend gets that (see step 5).
```

The SDK does not present any user-facing UI as part of the Discovery flow. Any confirmation prompt or number-display UX is application-side code you write after your backend has fetched the MSISDN (see step 6). See [User consent and displaying the number](/products/number-verification/discovery.md#user-consent-and-displaying-the-number) on the product page.

## 4. Response handling

On success, the SDK's completion callback carries a `code` returned by the redirect chain. On failure (MNO not supported, no cellular data at the moment of the call, redirect failure), the callback carries an error.

```swift
// Conceptual:
// - On success: extract `response_body.code`, forward to your backend
//   (see step 5), then wait for your backend to give you the MSISDN
//   or the terminal state to display.
// - On SDK error: see SDK error codes and route to a fallback.
```

## 5. Send the code to your backend

Pass the `code` to your backend over your own application API. Your backend submits the code to IDlayr's completion endpoint and receives the discovered MSISDN in the response — see [Backend integration → Submit the code](/products/number-verification/discovery/integration/backend.md).

## 6. Display the number (optional)

Once your backend has the MSISDN, you can pass it back down to the app if your UX calls for it — for example to show the user a "yes this is my number" confirmation. Whether to show the full number, a masked view, or skip the confirmation entirely is your choice.

## SDK errors

Same set as Secure SNA — `sdk_no_data_connectivity`, `sdk_connection_error`, `sdk_redirect_error`, `sdk_error`, `invalid_scheme`. See [SDK errors](/get-started/sdks/errors.md) for the cross-platform catalogue.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.idlayr.com/products/number-verification/discovery/integration/ios.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
