📱eNROLL iOS Framework

1. REQUIREMENTS

  • minimum Xcode version 14.2

  • minimum iOS Deployment 13.0

2. INSTALLATION

1. Manual Installation

  1. Download the zip file from Versions page.

  2. Unzip the file you will find EnrollFramework.xcframework file

  3. Add the EnrollFramework.xcframework to your project folder then drag and drop the file to the Frameworks extension like the screenshot below with Embed & Sign:

  4. Add the following sources to the Podfile

source 'https://github.com/innovatrics/innovatrics-podspecs'
source 'https://github.com/CocoaPods/Specs.git'
  1. Add the following pods to the Podfile

  pod 'dot-face-detection-fast', '7.5.1'
  pod 'dot-face-background-uniformity', '7.5.1'
  pod 'dot-face-expression-neutral', '7.5.1'
  pod 'dot-document', '7.5.1'
  1. run the following command on the project directory

pod install
  1. add the following to your project info.plist file

	<key>NSCameraUsageDescription</key>
	<string>"Your Message to the users"</string>
	<key>NSLocationWhenInUseUsageDescription</key>
	<string>"Your Message to the users"</string>

  1. Finally, ask for your license then drag and drop it to your project navigator files with copy files if needed checked like the below screenshot

3. IMPORT

import EnrollFramework

4. USAGE

  1. First Apply to EnrollCallBack Protocol to use callbacks from the framework

class YourViewController: UIViewController, EnrollCallBack {

    func onInitializeRequest(requestId: String) {
        
    }

    func onSuccess(documentNumber: String, applicantId: String) {
        
    }
    
    func onError(message: String) {
        
    }
}
  1. Initialize Steps:

    1. Initialize EnrolIInitModel and wrap it with do catch block

    2. Call EnrollFramework.initViewController in the present method

do{
            
            let enrollInitModel = try EnrollInitModel(tenantId: \(tenantIdValue), tenantSecret: \(tenantSecretValue), enrollEnviroment: (.production || .staging), localizationCode: (.en || .ar), enrollCallBack: self, enrollMode: (.onboarding || .authentication || .update || forget , skipTutorial: Bool?, enrollColors: EnrollColors?, levelOffTrustId: String?, applicantId: String?, updateSteps: [EnrollUpdateTypes]?))            

  } catch {
        
  }

  1. Launch Enroll:

let enrollViewController = Enroll.initViewController(enrollInitModel:                                     enrollInitModel, presenterVC: self)
            // Present Enroll View Controller
            self.present( enrollViewController, animated: true)

5. VALUES DESCRIPTION

EnrollInitModel:

Keys
Values

tenantId

String argument represents the organization id (Tenant ID) (should not be empty or nill)

tenantSecret

String argument represents organization secret (Tenant Secret) (should not be empty or nill)

enrollEnviroment

enum argument represents the working environment (production || staging) (staging is the default)

localizationCode

enum argument represents the framework language ( .ar || .en ) (default is .en) pass it based on your app language to match it.

enrollCallBack

a delegate for the enroll callbacks

onSuccess

Call back function when the enrollment finishes successfully.

onError

Call back function fires when an error occurs during the enrollment

EnrollColors

An object used to change the default enroll colors. (it is an optional and the default is enroll main colors)

EnrollMode

The you want to operate with and it has four types ( onboarding, authentication, update and forget ). Specify one that you need to do the job

levelOffTrustId

the id for the authentication methods you have set (Required in case of authentication mode)

applicantId

the id for the user you want to authenticate or update (Required in case of authentication and update modes)

updateSteps

is is enum for the steps you want to show to the user when update. You can leave it nil value if you want to show all the available update steps to the user.

skipTutorial

in can of onboarding mode, passing true skipTutorial parameter make the user pass the tutorial screens and navigate to the first step of the onboarding process. (default is false)

EnrollColors:

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

Last updated