iOS SDK Documentation

iOS SDK Version 1.0.5

Updates in new version

  • Includes a ready-to-use database file for easier deployment and integration.
  • Now supports on-premise deployments, providing greater control and security.
  • Improved interface and performance for a more seamless and intuitive experience.

Steps of using iPASS iOS Package

To explain how a user can use the iPASS Package in steps, you can outline the process as follows:

Steps to use iPASS iOS Package

Integrate Package into the App

  • First we need to add package to application using git link => 'https://github.com/yazanalqasem/iPass2.0NativeiOS'
  • Steps to add package: Go to files > Add Package Dependencies > Paste the Package URL
  • Click on Add Package to include package in your project.

Import Package

Import Package in your required view controller.

import iPass2_0NativeiOS

Configure Permissions in Info.plist

In this step user will give required permissions in the Info.plist file to enable the necessary device features:

  • Privacy - Camera Usage Description — Description for camera access.
  • Privacy - Photo Library Usage Description - Description for photo library access.
  • Privacy - Bluetooth Always Usage Description - Description for Bluetooth access.
  • Privacy - Speech Recognition Usage Description - Description for speech recognition.
  • Privacy - Privacy - NFC Scan Usage Description - Description for NFC usage.
  • ISO7816 application identifiers for NFC Tag Reader Session - For NFC features.

    Add following items to above array item

    • A0000002471001
    • E80704007F00070302
    • A000000167455349474E
    • A0000002480100
    • A0000002480200
    • A0000002480300
    • A00000045645444C2D3031
  • com.apple.developer.nfc.readersession.formats. - NFC reading formats

    Add following items to above array item

    • NDEF
    • TAG
  • Add App Transport Security Settings Dictionary

    • Set Allow Arbitrary Loads bool True to above dictionary item

Add NFC Compatibility

Near Field Communication Tag Reading

  • iPass supports On-Prem server integration. To use an on-prem server, provide the server URL in the serverUrl parameter.

    • If serverUrl is an empty string, the data will be saved on the iPass server.
    • If serverUrl contains a valid URL, the data will be saved on your on-prem server.
  • To start the process user need to download the database. iPass sdk supports two type of database systems.

    • Pre-packaged Database
    • Dynamic Database

Pre-packaged Database:

This type of database is bundled within the SDK itself. It is a pre-configured and read-only database that comes as part of the app's installation package. Since the database is local to the app, querying this database is generally faster, as it does not involve network latency. This is a custom database designed to meet specific requirements. If you need a custom database tailored to your needs, you can request one by contacting our support team at info@ipass-mena.com.

Dynamic Database:

This type of database is not included in the initial app package but is instead downloaded from a remote server when the app is launched or when certain conditions are met. The server-side database can be updated independently of the app, allowing for more dynamic content and real-time data management. In this database downloading time depends on the internet speed.

Pre-packaged Database Implementation:

DataBaseDownloading.initializePreProcessedDb(serverUrl: "http://192.168.19.421/", dbType: DataBaseDownloading.availableDataSources.fullDb, completion:{status, error in
    print(status, error)
})
  • In the completion, When the status is Start Now, you can start the next step.
  • Any type of error will be visible in error object
  • Replace http://192.168.19.421/ with your actual on-prem server URL if applicable.
  • In the Pre-packaged Database, System allows you to choose between three types of databases.
    1. DataBaseDownloading.availableDataSources.basicJordan
      • This database stores all types of documents for Jordan but only passports for other countries. It does not include authentication checks.
    2. DataBaseDownloading.availableDataSources.fullAuthJordan
      • This database stores all types of documents for Jordan but only passports for other countries. It also includes authentication checks.
    3. DataBaseDownloading.availableDataSources.fullDb
      • This database stores all types of documents for all countries. It does not include authentication checks.

For authentication checks, you need to enable hologram option using the following code snippet. By default, this option is disabled:

configProperties.needHologramDetection(value: true)

Dynamic Database Implementation:

DataBaseDownloading.initializeDynamicDb(serverUrl: "http://192.168.19.421/", completion:{progres, status, error in
    print(progres, status, error)
})
  • From the completion, Progress object can be used to track the downloading percentage.
  • Once the database is downloaded 100% and status is Start Now, user can start the next step.
  • Any type of error will be visible in error object
  • Replace http://192.168.19.421/ with your actual on-prem server URL if applicable.

Before using the SDK, you need to set up the delegate to receive callbacks

iPassSDKManger.delegate = self

Add Delegate to Get Response

extension ViewController : iPassSDKManagerDelegate {

    func getScanCompletionResult(result: String, transactionId: String, error: String) {
        print(result)
        print(transactionId)
        print(error)
    }
}
  • "result" object will return the required json response
  • "transactionId" object will return the unique transcation number for completed transaction
  • "error" object will return the error description

  • Retrieve User Login Token
    • Pass a valid email and password to authenticate the user and obtain the login token.

iPassSDKManger.UserOnboardingProcess(email: emailStr, password: passwordStr) { status, tokenString in
    if(status == true) {
        self.userToken = tokenString!
    }
}

    var getList = [[String: Any]]()
    getList = iPassSDKManger.getWorkFlows()
  • In the getList object you will get the array of dictionary with all the flows
  • Get the flowId from the list of supported flows which will be required for scanning process
  • Sdk Supported Flows

    • Full Processing(10031)
    • Id verification + Liveness + AML(10032)
    • Id verification + AML(10015)
    • Id verification + Liveness(10011)
  • In Full Process(10031), Social media email and phone number is required

  • User can scan various types of documents.
  • Users can scan both the front and back sides of documents, but it totally depends on the document type.

Code to scan document

iPassSDKManger.delegate = self

iPassSDKManger.startScanningProcess(userEmail: "sam@gmail.com", flowId: 10031, socialMediaEmail :"samfb@gmail.com", phoneNumber : "978xxxxxx", controller: self, userToken: self.userToken, appToken: self.appToken)
  • usertoken will be the login token
  • appToken will be the auth token provided by Admin
  • flowId will be the id selected by the user from above step.
  • After the scanning process, Response will be available in package delegate.

    configProperties.setLoaderColor(color: UIColor.red)
    configProperties.needHologramDetection(value: true)
    configProperties.setDateFormat(format: "dd/mm/yyyy")
  • "setLoaderColor" property is used to change the color of the loader
  • "needHologramDetection" property is used for Authenticity checks like detection of Electronic Device, Optically Variable Ink, Multiple Laser Images, Image Patterns
  • By default hologram detection is enabled. you can disabled passing the false in hologram detection property
  • "setDateFormat" property is used to change the format of dates displayed in the results. The mask examples are "dd/mm/yyyy", "mm/dd/yyyy", "dd-mm-yyyy", "mm-dd-yyyy", "dd/mm/yy".
    configProperties.needHologramDetection(value: false)

Applications supports following languages

  • Arabic
  • English
  • French
  • German
  • Kurdish
  • Kurdish, Sorani
  • Spanish
  • Turkish
  • Urdu

You need to add the multi languages files from the xcode for required languages and you can copy the language keys from the following link

Configuring Webhook URL in Your iPass Account

Your iPass account can be set up to send an HTTP POST request with JSON data to a specified URL upon the completion of an onboarding process. This URL can be configured in the account profile section of the iPass web application.

Steps to Configure the Webhook URL:

  • Log in to your iPass dashboard.
  • Navigate to the "My Profile" section
  • Click the "Edit" button, enter your webhook URL in the designated field, and click "Update." Your webhook URL will now be added.

We also provide the webhook signature verification here are the instructions to generate the signature in the node js.

const generateSignature = (uid, secret) => { return crypto.createHmac('sha256', secret) .update(JSON.stringify(uid)) .digest('hex'); };
const uid = { uid(uid that will sent you on webhook eg:ad962a61-6dcb-49cd-a863-353b1a5342cc) };
const secretKey = 'secret-key which we share you securely';
const signature = generateSignature(uid, secretKey);

From our side you can get the signature in the headers of webhook.