Usage

4Minimum Requirements

  1. iOS 11

Installation

Download our framework through CocoaPods

pod 'ValifyEKYC', '~> 1.4.0'

Authentication

In order to generate an access token that will be used in the SDK authentication settings, use our authentication service API.

Configuration

Add the following Add the following key to the app’s info.plist file

Privacy - Camera Usage Description

Import the framework

import ValifyEKYC

Implement valifyDelegate to your class

class ViewController: UIViewController, valifyDelegate {

Confirm your class to the protocol

valify.sharedInstance.delegate = self

Configuring your SDK settings

let settings = valifyBuilder()

// Authentication (required)
.set(bundle: String)            // bundle id
.set(token: String)             // authentication token
.set(baseURL: String)

// (SDK flow)
.withTerms(_ withTerms: Bool)
.withTutorial(_ withTutorial: Bool)
.withOCR(_ withOCR: Bool)
.withDocumentVerification(_ withDocumentVerification: Bool)
.withWatermarkCheck(_ withWatermarkCheck: Bool)
.withDataUpdating(_ withDataUpdating: Bool)
.withLiveness(_ withLiveness: Bool)
.withFaceMatch(_ withFaceMatch: Bool)
.withRating(_ withRating: Bool)
.withoutPreviewData(_ withoutPreviewData: Bool)
.withoutPermissionsScreen(_ withoutPermissionsScreen: Bool)

// Language (optional) (default: English)
.set(language: valifyLanguage)

// FaceMatch settings (optional)
.withCustomFaceMatchTransactionID(transactionID: String)
.withCustomFaceMatchImage(customFaceMatchImage: UIImage)


// Liveness settings (optional)
.set(livenessNumOfInsructions: 2)
.set(livenessNumOfTrials: 4)
.set(livenessTimerSeconds: 30)
.withoutSmile(_ withoutSmile: Bool)
.withoutLookLeft(_ withoutLookLeft: Bool)
.withoutLookRight(_ withoutLookRight: Bool)
.withoutCloseEyes(_ withoutCloseEyes: Bool)

// (SDK flow)
.build()

Your app must support landscape orientation in order for our SDK to work properly. If you require your app views to be in portrait orientation only, you can use View-Based orientation lock in order to have your app views restricted to portrait mode.

If you use the Face Match service after the OCR or OCR w/ Verification service then the face in the front side image of the national ID captured during the OCR or OCR w/ Verification step will be used for comparison with the image captured during the Face Match step.

If you use the Face Match service separately, you need to either pass an image or a transactions id for a hit previously made to our OCR or OCR w/ Verification service for comparison with the image that will be captured for the user going through the SDK experience:

// FaceMatch settings (optional)
.withCustomFaceMatchTransactionID(transactionID: String)
.withCustomFaceMatchImage(customFaceMatchImage: UIImage)

Run the SDK (must be called after viewDidAppear has already been called, for example, in a button action)

let valifyRun = valifyFlow.init(withSettings: settings, fromViewController: self)

do {
      try valifyRun.run()
} catch {
      print(error)
}

When you implement valifyDelegate you’ll have to add the required method of the protocol

func didFinishProcess(_ valifyResponse: valifyResponse, _ valifyToken: String)

This didFinishProcess function will be called once the framework has finished, and it will return the session’s token and valifyResponse object which is an enumerator of the following cases

  1. success: the user has completed the experience successfully. The Valify token (valifyToken), and the data collected (valifyResult) are returned.

  2. userExited: the user exits the SDK voluntarily returning to the main app. The Valify token (valifyToken), and (userExited) object are returned to the app.

  3. error: the user aborts as a result of an error. The Valify token (valifyToken), (valifyError) are returned to the app.

Demo Application

The following is a demo application that illustrates how to integrate the Valify eKYC SDK inside your application:

Last updated