> For the complete documentation index, see [llms.txt](https://docs.sensecrypt.com/sensecrypt-v3.1.1/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sensecrypt.com/sensecrypt-v3.1.1/sensecrypt-mobile-sdks/ios-sdk.md).

# iOS SDK

The iOS SDK includes a core native library (closed-source) and a reference UI implementation provided in source code format. This setup allows you to fully customize the UI according to your application’s requirements. While this page provides an overview, you can read more detailed documents at [iOS SDK Documentation](https://media.seventhsense.ai/sensecrypt/mobile/3.1.1/ios/index.html).

The iOS SDK comes in two variants:&#x20;

* Online: This variant is small in size, but it needs to connect with the server for SensePrint eID verification/decryption.
* Offline: This variant larger in size, but it can be used to verify/decrypt SensePrint eIDs with no network connectivity and completely on a mobile device.

Both variants utilize the same reference UI implementation.  This means the same Swift source code is used for both variants. In the provided XCode workspace there are two XCode projects that point to the same source files. Based on the selected schema you can either build & run the online or offline app variant.

<figure><img src="/files/KhNKPHTTIAMZ7Qlz5FCi" alt=""><figcaption></figcaption></figure>

### Constants

The Constants files specify configuration parameters that can be set before compile time. The below screenshot shows the location of the Constants files for the Online and Offline variant:

<figure><img src="/files/rIhyLOhUMM6GYQgz8IiV" alt=""><figcaption><p>Location of the Constants files in Xcode</p></figcaption></figure>

### Important Constants (online SDK):

1. **API\_SERVER\_URL** - This value must point to your deployed server (e.g., via Docker). If using a temporary tunneling service like ngrok, ensure this constant holds the correct ngrok URL.<br>
2. **AUTH\_HEADER** - This value should be set to the `mobile_api_key` value you used in the `secrets.json` file while [starting the Docker container](/sensecrypt-v3.1.1/sensecrypt-server/starting-the-server.md) for the server. If you are [using a JWT Token for mobile authorization](/sensecrypt-v3.1.1/sensecrypt-server/using-a-jwt-token-for-mobile-authorization.md), this should be set to `Bearer your_jwt_token_from_server`<br>
3. **SENSEPRINT\_VERIFIER\_AUTH\_KEY** (optional) - A secret that is shared with a generator of the eID SensePrint. If it is specified, the eID issuer must specify the same value while generating a SensePrint that the app will accept. See [Generating your first SensePrint eID QR](/sensecrypt-v3.1.1/sensecrypt-server/sensecrypt-eid/generating-your-first-senseprint-eid-qr.md).

### Important Constants (offline SDK):

1. **SENSEPRINT\_VERIFIER\_AUTH\_KEY** (optional) - A secret that is shared with a generator of the eID SensePrint. If it is specified, the eID issuer must specify the same value while generating a SensePrint that the app will accept. See [Generating your first SensePrint eID QR](/sensecrypt-v3.1.1/sensecrypt-server/sensecrypt-eid/generating-your-first-senseprint-eid-qr.md).<br>
2. **ISSUERS\_PUBLIC\_KEY** - An Secp256k1 curve public key in Base64 format. When the SenseCrypt server is operating in Certificate Authority mode (has a `issuers_private_key` set in its [Configuration](/sensecrypt-v3.1.1/sensecrypt-server/configuration.md)), the corresponding public key ***must*** be specified in the app as all SensePrints that are generated by the server are signed when it is operating in CA mode. The app ***must*** verify signed SensePrints using the public key.

### Important Views

1. **SplashScreen**

   \
   Responsible for initializing the SDK and loading the necessary Machine Learning models into memory. This is the first view triggered when the application launches.\
   \
   The `SplashScreen` culminates by loading the `MainView`. <br>
2. **MainView**\
   \
   A simple interface displaying entry points for SensePrint eID QR generation, verification and reading. Users can interact with buttons to proceed with either operation.<br>
3. **GenerateQRView**\
   \
   Triggered from either the `ActiveFaceCaptureView` or the `PassiveFaceCaptureView`, this activity allows the user to input eID attributes (e.g., name, record ID) needed for QR code generation.<br>
4. **QRScannerView**\
   \
   Scans the generated QR code containing the user’s face and other details. If the QR code is password-protected, the user will be prompted to enter the password before personal details can be decrypted.<br>
5. **PassiveFaceCaptureView**\
   \
   This view captures a single, good image of a user using the camera. The captured image can then be used to generate/verify a SensePrint QR.<br>
6. **ActiveFaceCaptureView**\
   \
   This view uses the camera to capture facial images but prompts the user to position their head in 3 random positions before their face is captured. This presents added security against injection attacks.<br>
7. **PersonDetailView**\
   \
   This View contains all the details user will see after successfully scanning and decrypting a SensePrint QR code.

### Additional Notes

The SDK is designed for modularity, allowing full customization of the user interface and integration flows while maintaining core functionality within a closed-source native library.

This document serves as a guide to understand and integrate the iOS SDK into your application. Be sure to configure the constants accurately to align with your deployment setup and security requirements.


---

# 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:

```
GET https://docs.sensecrypt.com/sensecrypt-v3.1.1/sensecrypt-mobile-sdks/ios-sdk.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
