iOS

Guide for integrating Cactusverify SDK into a Swift project

Use Cactusverify SDK to easily integrate into your Android app. Before integrating Cactusverify, it is recommended to follow the steps described in Integration Guide and Initial Setup.

Installation

Add the following to the project's main Podfile file:

source 'https://github.com/CocoaPods/Specs.git'
source 'https://github.com/Kvalifika/kvalifika-cocoapods-specs.git'
source 'https://github.com/Kvalifika/zoom-cocoapods-specs.git'

platform :ios, '11.0'

# Your Target
target 'kvalifika-swift-sample' do
  use_frameworks!

  pod 'Kvalifika'
end

If you want to update pod run in terminal:

pod update Kvalifika

Initialize the SDK

import Cactusverify

After that, you need to initialize SDK with your appId.

appId is Application ID, generated from Admin Panel. See Initial Setup for details.

App Permissions

Please add the following permissions to your app's Info.plist, so that the Cactusverify iOS SDK can access a user's camera to run a verification. You can do this in the property list view or by code. Right-click on Info.plist and select Open As -> Source Code. Add the lines below somewhere inside the file <dict> </dict>

Start Verification

Call Kvalifika.startSession() on button click event

Handling Verifications

It's useful to know that whether a user has completed the verification flow or canceled it. For this, you can implement the callback methods.

Callback Methods

Method

Description

onInitialize

This callback method is triggered when SDK is initialized.

onStart

This callback method is triggered when the user starts verification.

onFinish

This callback method is triggered when the user completes verification. Get session data here.

onError

This callback method is triggered on error (see Error Codes for more information)

Error Codes

Error Code

Description

INVALID_APP_ID

Kvalifika App Id is incorrect

USER_CANCELLED

User canceled before completing verification.

TIMEOUT

Canceled due to inactivity.

SESSION_UNSUCCESSFUL

The Session was not performed successfully

ID_UNSUCCESSFUL

The ID Scan was not performed successfully and identity document data was not generated.

CAMERA_PERMISSION_DENIED

Camera is required but access is prevented by user settings.

LANDSCAPE_MODE_NOT_ALLOWED

Verification was canceled because the device is in landscape mode.

REVERSE_PORTRAIT_NOT_ALLOWED

Verification was canceled because the device is in reverse portrait mode.

FACE_IMAGES_UPLOAD_FAILED

Could not upload face images. Internal request failed.

DOCUMENT_IMAGES_UPLOAD_FAILED

Could not upload ID card or passport images. Internal request failed.

NO_MORE_ATTEMPTS

User has reached maximum limit of attempts

UNKNOWN_INTERNAL_ERROR

Session failed because of an unhandled internal error.

UI Customizations

Appearance

It is possible to customize the logo and icons and provide resource names.

Language

It is possible to set locale when initializing SDK. Supported locales are:

Code

Language

EN

English

GE

Georgian

RU

Russian

SP

Spanish

Development Mode

Without specifying mode SDK uses https://api.kvalifika.com

With development mode ON SDK uses https://apistaging.kvalifika.com

Last updated

Was this helpful?