Get started with iOS SDK

Latest release: Version 1.31.0 (Changelog)


  • Xcode 14.1+
  • iOS 11.0 or later
    • MRTDReader module requires iOS 13+



Make sure bitcode is disabled for your project.



The framework is available to install with Swift Package Manager or CocoaPods.

Swift package manager

Add to your project as a package dependency:

  • Add IdensicMobileSDK library to your target.
  • Add optional libraries if you need them. For more information, see MRTDReader and VideoIdent.



Twilio since 5.0.0 only supports iOS 12.2+. If you want to use Twilio higher than 4.6.3, set the ios-12.2 branch when adding the package dependency and ensure that your minimum deployment target is iOS 12.2+.


  1. Update your Podfile:
    • Add source options for SumSubstance and CocoaPods repositories.
    • Add IdensicMobileSDK dependency to your target.
    • Add optional dependencies if you need them. For more information, see MRTDReader and VideoIdent.
platform :ios, '11.0'

source ''
source ''

target 'YourApp' do
  pod 'IdensicMobileSDK'
  # pod 'IdensicMobileSDK/MRTDReader'
  # pod 'IdensicMobileSDK/VideoIdent'

  # any other dependencies
  1. Run the following command in your project directory.
pod install


The framework will ask for access to the camera and microphone, photo library, and geolocation. Because of this, it is required to have the corresponding usage descriptions in the application Info.plist file.

<string>Let us take a photo</string>
<string>Time to record a video</string>
<string>Let us pick a photo</string>
<string>Please provide us with your geolocation data to prove your current location</string>



If your app targets iOS 10 and below, it is required to turn on the iCloud Documents capabilities in Xcode as described in this article.


MRTDReader (NFC)

The MRTDReader is an optional module that allows SDK to detect and read the electronic chips placed on MRTD documents via NFC.

To enable this functionality:

  1. Add the module:
    • Swift Package Manager β€” add the IdensicMobileSDK_MRTDReader library to your target.
    • CocoaPods β€” add the IdensicMobileSDK/MRTDReader dependency into your Podfile.
  2. Turn on the Near Field Communication Tag Reading capability for your project target.
  3. Update the application Info.plist file as follows:
<string>Let us scan the document for more precise recognition</string>


The VideoIdent is an optional module required only if you are going to use the Video identification during verification.

To enable the module:

  1. Add the module:
    • Swift Package Manager β€” add the IdensicMobileSDK_VideoIdent library to your target.
    • CocoaPods β€” add IdensicMobileSDK/VideoIdent dependency into your Podfile.
  2. Add the Background mode capability for your project target and select the Audio, AirPlay and Picture in Picture options. This is required for the video call not to be broken when the application goes into background.

Basic usage



Make sure you have configured your verification level and access token before initializing the SDK.


To initialize MobileSDK:

  1. Import the framework.
import IdensicMobileSDK
  1. Declare the initialization parameters.
let accessToken = "..." // get the `accessToken` from your backend

As you can see, the only thing you need is an accessToken from your backend. The token points to the verification level that defines the steps of the verification process and indicates an applicant to be verified.

The MobileSDK will work in the production or sandbox environment, depending on which one the accessToken has been generated on.

  1. Instantiate SNSMobileSDK and check if setup succeeded.
let sdk = SNSMobileSDK(
    accessToken: accessToken

guard sdk.isReady else {
    print("Initialization failed: " + sdk.verboseStatus)

Here you create an SDK instance and ensure that the setup was successful with sdk.isReady. If it happens to fail, you will be able to pinpoint the reason by printing sdk.verboseStatus.

  1. The next important step is to set the tokenExpirationHandler. Typically, the access token is valid for a rather short period of time and when it is expired, you must provide another one. For more information, see Token expiration.
sdk.tokenExpirationHandler { (onComplete) in
    get_token_from_your_backend { (newToken) in

Most likely, you will then tune up the SDK a bit further by assigning Handlers and Callbacks, and by applying some Configuration and Customization, but that's just an optional feature.



We know that the requirement to provide the accessToken as an initialization parameter forces you to ask your backend, and due to the async nature of this process, you'll have to build some UI around.

For your convenience, it's possible to postpone the provision of the token until the SDK has been presented.

To do so, you will need to pass an empty string as accessToken at the initialization stage. This way the tokenExpirationHandler will be called immediately after the SDK is appeared up at the time when an activity indicator is displayed.


Once setup is done you are ready to present the SDK on the screen.

yourViewController.present(sdk.mainVC, animated: true, completion: nil)

Since SDK contains its own navigation stack, it's required to be presented modally instead of being pushed.

You can also use a shortcut like this.

sdk.present(from: yourViewController)

Or even shorter if it's comfortable for you to present the SDK on the key window root view controller.



By default, once the applicant is approved, the SDK will be dismissed in 3 seconds automatically. You can adjust this time interval or switch the automatic dismissal off by setting the value of zero.


Also, in case you need to close the SDK programmatically.



Applicant data

For your convenience and if required, you can provide an email and/or phone number to be assigned to the applicant initially.

sdk.initialEmail = "..." // applicant's email
sdk.initialPhone = "..." // applicant's phone number

Preferred documents

For the IDENTITY* steps, it is possible to specify the preferred country and document type to be selected automatically bypassing the DocType Selector screen.

Pay attention that the provided parameters will be applied only if the corresponding combination of country and idDocType is allowed at the step according to the level configuration.

For example:

sdk.preferredDocumentDefinitions = [
    .identity: SNSDocumentDefinition(
        idDocType: "DRIVERS",
        country: "USA"