πŸ“±eNROLL iOS Framework

This document is a guide for integrating the EnrollFramework iOS SDK. It provides the steps required to install, configure, and use the SDK within your iOS application.

1. Requirements

  • Xcode: β‰₯ 14.2

  • iOS Deployment Target: β‰₯ 13.0


2. Installation

We now distribute EnrollFramework via a private CocoaPod for easier integration.

  1. Add our private specs repo to your Podfile (before the CocoaPods default one):

    source 'https://github.com/LuminSoft/eNROLL-iOS-specs.git'
    source 'https://github.com/innovatrics/innovatrics-podspecs'
    source 'https://github.com/CocoaPods/Specs.git'
  2. Add the EnrollFramework pod:

    pod 'EnrollFramework', '~> 1.5.0'

    βœ… You no longer need to declare these pods manually dot-face-detection-fast, dot-face-expression-neutral, etc. They are already included in our podspec.

  3. Install pods:

    pod repo add eNROLL-iOS-specs https://github.com/LuminSoft/eNROLL-iOS-specs.git
    pod install --repo-update

πŸ”Ή Manual Installation (Fallback)

If CocoaPods cannot be used, you can still integrate the .xcframework manually:

  1. Download the latest release from eNROLL-iOS Releases and extract the EnrollFramework.xcframework file.

  2. Add it to your project (drag & drop into Frameworks section with Embed & Sign).

3. Add dependencies to your Podfile:

pod 'FirebaseRemoteConfig','11.15.0'
pod 'dot-face-detection-fast', '8.10.0'
pod 'dot-face-background-uniformity', '8.10.0'
pod 'dot-face-expression-neutral', '8.10.0'
pod 'dot-document', '8.10.0'
  1. Run:

    pod install

3. Configurations

  1. Update your Info.plist:

    <key>NSCameraUsageDescription</key>
    <string>Your message to users</string>
    <key>NSLocationWhenInUseUsageDescription</key>
    <string>Your message to users</string>
  2. If you are using Xcode 15 or later Go to Build Settings β†’ search for User Script Sandboxing and set it to NO.

  1. Place your license file inside your project (drag & drop into Navigator, with Copy items if needed checked).


4. Import

import EnrollFramework

5. Usage

1. Conform to EnrollCallBack

class YourViewController: UIViewController, EnrollCallBack {
    func onInitializeRequest(requestId: String) { }
    func onSuccess(documentNumber: String, applicantId: String) { }
    func onError(message: String) { }
}

2. Initialize & Present

do {
    let enrollInitModel = try EnrollInitModel(
        tenantId: "<YOUR_TENANT_ID>",
        tenantSecret: "<YOUR_TENANT_SECRET>",
        enrollEnviroment: .production, // or .staging
        localizationLanguage: .en,         // or .ar
        enrollCallback: self,
        enrollMode: .onboarding        // or .authentication, .update, .forget, .signContarct
    )

    let enrollVC = Enroll.initViewController(
        enrollInitModel: enrollInitModel,
        presenterVC: self
    )

    self.present(enrollVC, animated: true)

} catch {
    print("Error initializing EnrollInitModel: \(error)")
}

6. Values Description

EnrollInitModel Parameters:

Keys
Values

tenantId

Required. Write your organization tenant id.

tenantSecret

Required. Write your organization tenant secret.

enrollMode

Required. Mode of the SDK. (See Enroll Modes).

enrollEnviroment

Required. Select the EnrollEnvironment: EnrollEnvironment.STAGING for staging and EnrollEnvironment.PRODUCTION for production.

enrollCallback

Required. Callback function to receive success and error response.

localizationLanguage

Required. Select your language code: LocalizationEnum.EN for English, and LocalizationEnum.AR for Arabic. Default value is English.

googleApiKey

Optional. Google API Key to view the user’s current location on the map.

applicantId

Optional. Write your Application ID (Required for auth, update, and signContract).

levelOffTrustId

Optional. Write your Organization's level of trust (Required for auth).

skipTutorial

Optional. Choose to ignore the tutorial or not.

enrollColors

Optional. Collection of app colors you can override: primary, secondary, background, successColor, warningColor, errorColor, textColor.

customFontName

Optional. Font resource to set your font family.

correlationId

Optional. Correlation ID to connect your User ID with our Request ID.

contractTemplateId

Optional. The ID of the contract to be signed (Required for signContract).

signContarctParam

Optional. Extra contract parameters for signContract.

enrollForcedDocumentType

Optional. Accepts values from the EnrollForcedDocumentType enum: - passport β†’ The user must enroll using a passport. - nationalId β†’ The user must enroll using a national ID. - default β†’ Keeps the normal flow with standard document selection screen.

requestId

Optional. Write your request ID to continue a previously initiated request (runaway) instead of starting from the beginning.

EnrollColors:

Define custom colors for UI components inside the framework.

Keys
Values

primary

The Primary color used for all buttons and main items

secondary

Used for the minor views and items

appBackgroundColor

Used for the main background

textColor

Used for the text and content color

errorColor

Used for the error color

successColor

Used for the successful color

warningColor

Used for the warning color

appWhite

The main white color

appBlack

The main black color


7. ENROLL MODES

The SDK supports 4 modes defined in the EnrollMode enum:

enum EnrollMode {
  onboarding,
  auth,
  update,
  signContract
}

Mode Details

Mode
Description
Requirements

onboarding

Registering a new user in the system.

tenantId, tenantSecret (required).

auth

Verifying the identity of an existing user.

tenantId, tenantSecret, applicantId, levelOffTrustId (all required).

update

Updating or re-verifying the identity of an existing user.

tenantId, tenantSecret, applicantId (required).

signContract

Signing contract templates by a user.

tenantId, tenantSecret,contractTemplateId, applicantId(required). Optional: signContarctParam.

Last updated