Skip to main content

iOS SDK Guide

This guide outlines the steps for integrating the SMSDK framework into your iOS application, enabling identity validation processes through facial biometric verification or document scanning.

Installation
  1. Add the library
    • Download the "SMSDK.xcframework" file.
    • In your Xcode project, navigate to the target's general settings.
    • Go to the "Frameworks, Libraries, and Embedded Content" section.
    • Click the "+" button and add the "SMSDK.xcframework" to your project. Ensure it's set to "Embed & Sign".
  2.  Import Required Libraries

In the file where you plan to use the SDK, import the necessary libraries:

swift

import UIKit
import AdoComponent

The TransactionResponse object will contain the results of the transaction, providing detailed feedback on the validation process.

Minimum SDK Version for iOS


Update the minimum iOS version to iOS 11.0:

  • Navigate to your target's Build Settings.
  • Find the "Deployment" section.
  • Set the "iOS Deployment Target" to iOS 11.0 or higher.
Example Implementation

To initiate the SMSDK framework, use the initWith method from the SMManager class. This method requires a delegate and an SMParams object containing the launch parameters. Implement the SMDelegate extension to handle the SDK's response.

Intialization
let params = SMParams(productId: "1",
                      projectName: "lulobankqa",
                      apiKey: "db92efc69991",
                      urlSdk: "https://adocolumbia.ado-tech.com/lulobankqa/api/",
                      token: "",
                      function: 1, // 1 for Liveness, 2 for Document Scanning
                      isFrontSide: false, // true for front, false for back of the document
                      uidDevice: "",
                      language: "en") // "en" for English, "es" for Spanish

let smManagerVC = SMManager.initWith(delegate: self, params: params)
smManagerVC.modalPresentationStyle = .fullScreen
present(smManagerVC, animated: true, completion: nil)

// MARK: - SMDelegate
extension ViewController: SMDelegate {
    func completedWithResult(result: Bool, response: ResultsResponse?) {
        dismiss(animated: true) {
            // Handle the SDK response here
        }
    }
}

Parameters Explained
  • productId: Identifier for the product being used.
  • projectName: Your project identifier provided by the service.
  • apiKey: Your API key for authentication with the service.
  • urlSdk: The base URL for the SDK's services.
  • token: Optional token for additional authentication (if required).
  • function: Determines the operation mode (e.g., 1 for Liveness, 2 for Document Scanning).
  • isFrontSide: Indicates which side of the document to capture.
  • uidDevice: A unique identifier for the device.
  • language: Specifies the language for the SDK interface.
Resources

Resource files, including animations provided by the client, can be found at the following path within your project:

SMSDKTest/Resources/Animations

Ensure these resources are correctly integrated into your project for the SDK to function as intended.

State Codes Reference

Be aware of the following state codes when processing responses:

  • 200: "SUCCESS"
  • 201: "THE_NUMBER_OF_CONFIGURED_ATTEMPTS_WAS_EXCEEDED_AND_NO_LIFE_WAS_FOUND_IN_THESE"
  • 203: "TIMEOUT"
  • 204: "CANCELED_PROCED"
  • 205: "PERMISSIONS_DENIED"
  • 401: "TOKEN_ERROR"
  • 404: "INVALID_CREDENTIALS"
  • 500: "CONNECTION_ERROR"
Demo Application

For a comprehensive example, including full source code demonstrating the integration and usage of the Scanovate Colombia SDK, visit our GitHub repository:

Scanovate Colombia SDK Demo App For iOS

This demo app provides a hands-on example to help you understand how to integrate and utilize the SDK in your own applications.