# iOS SDK

# Demo Project

Demo project and its source code can be found here.

# Latest release

Version 2.11.1

In order to ensure that our SDK works smoothly on iOS 13 you have to update to version 2.10 at least.

# Prerequisites

  • iOS 9.3 or later

# Changelog


2.x

  • 2.11.1
    • Improvements of Liveness module's fallback-to-video policy
  • 2.11
    • Stability improvements
    • Liveness3D module fix to make it perform correctly being opened from a non-fullscreen presenter
    • Optional ability to show Close button in Chat when all required documents are uploaded and when verification is finished
    • engine.onActionEvent callback added
  • 2.10
    • iOS 13 Dark Mode support (please revise your color scheme if you use the custom one)
    • Liveness3D module updated to be compatible with iOS 13 on some devices (the localization strings table has been changed, please revise)
  • 2.9.3
    • Liveness3D module in Face Match mode
  • 2.9.2
    • Ability to customize color theme of Liveness3D module
  • 2.9.1
    • Localization support for Liveness3D module
  • 2.9
    • Liveness3D API
    • Ability to customize preferredStatusBarStyle, Navigation Title color and Back Button indicator
    • Bugfixes
  • 2.8
    • Brand new face liveness check
    • Deprecated UIWebView replaced with WKWebView
  • 2.7
    • Report "Connecting" and "Wait for network" states
    • Bugfixes

# SDK

# Installation

This framework ment to be installed via cocoapods.

  • Add to your Podfile specs repositories: SumSubstance/Specs, and public one - CocoaPods/Specs
  • Specify use_frameworks! option
  • Add dependency SumSubstanceKYC to your target

Resulting Podfile could look as follows:

platform :ios, '9.3'

source 'https://github.com/CocoaPods/Specs.git'
source 'https://github.com/SumSubstance/Specs.git'

use_frameworks!

target 'MyAwesomeApp' do

  pod 'SumSubstanceKYC'

  # any other dependencies
end
  • Run pod install --repo-update

# Permissions

The framework will ask to have access to the camera and microphone, so it's required to have the corresponding usage descriptions in the application's Info.plist file. Something like this:

	<key>NSCameraUsageDescription</key>
	<string>Let us make a photo</string>
	<key>NSMicrophoneUsageDescription</key>
	<string>Time to record video</string>

# Usage

Before you initialize our SDK you need to do two things:

  • Create an applicant on your backend and note its applicantId
  • A method for generating a mobile SDK token on your backend

Don't store your API credentials or auth token in your app code.

Getting this data is described here.

To instantiate the framework call:

SSEngine *engine = [SSFacade setupForApplicant:applicantID
                                     withToken:authToken
                                        locale:locale
                                  supportEmail:supportEmail
                                       baseUrl:baseUrl
                                   colorConfig:colorConfigOrNil
                                   imageConfig:imageConfigOrNil];

where

  • applicantID - your applicant identifier
  • authToken - your Sum&Sub auth token
  • locale - user locale (preferably NSLocale.currentLocale.localeIdentifier, but you can use any)
  • baseUrl - test-msdk.sumsub.com for test environment or msdk.sumsub.com for production one
  • colorConfigOrNil - nil or subclass of KYCColorConfig (for color pallet customization)
  • imageConfigOrNil - nil or subclass of KYCImageConfig (for icons customization)

Then you should:

  • Connect to remote - [engine connectWithExpirationHandler:verificationResultHandler:]
  • Create KYC UI - [SSFacade getChatControllerWithAttributedTitle:titleOrNil]
  • Refresh auth token (when needed) - engine.refreshToken = newToken

# Face authentication module

# Installation

This framework is meant to be installed via cocoapods.

  • Add to your Podfile specs repositories: SumSubstance/Specs, and public one - CocoaPods/Specs
  • Specify use_frameworks! option
  • Add dependency SumSubstanceKYC/Liveness3D to your target

Resulting Podfile could look as follows:

platform :ios, '9.3'

source 'https://github.com/CocoaPods/Specs.git'
source 'https://github.com/SumSubstance/Specs.git'

use_frameworks!

target 'MyAwesomeApp' do

  pod 'SumSubstanceKYC/Liveness3D'

  # any other dependencies
end
  • Run pod install --repo-update

# Usage

Instantiate the module and pass handlers

SSLiveness3D *liveness3D =
[SSLiveness3D.alloc initWithBaseUrl:baseUrl
                        applicantId:applicantId
                              token:token
                             locale:locale
             tokenExpirationHandler:^(void (^ _Nonnull completionHandler)(NSString * _Nullable))
 {
     // get new token then call completionHandler
     getNewToken(^(NSString *token) {
        completionHandler(token);
     };
     
 } completionHandler:^(UIViewController * _Nonnull controller, SSLiveness3DStatus status, SSLiveness3DResult * _Nullable result) {
     
     // process status then update UI accordingly

     // possible statuses are:
     // SSLiveness3DStatus_Cancelled,
     // SSLiveness3DStatus_InitializationFailed,
     // SSLiveness3DStatus_CameraPermissionDenied,
     // SSLiveness3DStatus_TokenIsInvalid,
     // SSLiveness3DStatus_FaceMismatched,
     // SSLiveness3DStatus_VerificationPassedSuccessfully,

     [controller dismissViewControllerAnimated:YES completion:nil];
 }];

Where

  • baseUrl - test-msdk.sumsub.com for test environment or msdk.sumsub.com for production one
  • applicantId - identifier of the applicant to check against
  • token - your Sum&Sub auth token
  • locale - user locale (preferably NSLocale.currentLocale.localeIdentifier, but you can use any)
  • optionally one can use liveness3D.theme property to assign a customized set of colors

Upon success use result.applicantActionId as #{actionId} to check the results against the server with the corresponding api call.

Note please that being initialized once the overall process is looped until cancelled or completes successfully. So normally you never got SSLiveness3DStatus_FaceMismatched completion status. Use the following to change this behaviour.

liveness3D.shouldCompleteOnFaceMismatch = YES;

Also there is an optional way to get the server response right after it arrives from the server. That allows you to process the result asynchronously and possibly cancel the further processing.

// The block must call `completionHandler` provided with a boolean parameter. Passing `YES` stops the further processing.

liveness3D.resultHandler = ^(SSLiveness3DResult * _Nonnull result, void (^ _Nonnull completionHandler)(BOOL)) {
  
    NSLog(@"Coordinator: Liveness3D got result from server: %@", result);
    
    completionHandler(NO);
};

Then create and display UI

UIViewController *vc = [liveness3D getController];

vc.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;

[self.navigationController presentViewController:vc animated:YES completion:nil];

# Customization

Texts within the Liveness3D module can be customized and/or localized with Zoom.strings file. Add it to your project, then modify/localize as required.

Colors could be adjusted by assigning liveness3D.theme an object that conforms to SSLiveness3DThemeProtocol

Last Updated: 1/18/2020, 4:49:35 PM