iOS Liveness Detection SDK (v4.1.1) User Guide

Overview

AAILivenessSDK contains the following modules: the core module AAILivenessSDK.xcframework, the UI module AAILivenessUI, the model resource module AAILivenessModel.xcframework, and the dependency modules AAINetwork.xcframework, AAICore.xcframework, AAIDataVisor.xcframework.

The total size of SDK is approximately 6.9MB (arm64, disable bitcode) or 5.5MB (arm64, disable bitcode, without model resource module AAILivenessModel.xcframework).

SDK requirements and limitations as below:

Compliance Explanation

See Compliance Explanation for more details.

Migration Guides

If you are upgrading from an older version of the Liveness SDK, please refer to this document to understand the changes.

Run demo project

  1. The demo project is included in the SDK compressed package. Download the AAILivenessSDK and extract it, then navigate to the directory of LivenessSDKSwiftDemo project and install the dependencies:

  2. Open xcworkspace file in Xcode.

  3. Specify your market and license content, then start SDK, the license content is obtained by your server calling our openapi.

Installation

  1. Specify the SDK name and url in the Podfile:

    Note if you are using static link configuration(that is, you haven't configured use_frameworks! in your Podfile), you need update the pod 'AAILivenessUI' as follows:

  2. Run pod install to install the dependencies in your project:

  3. Add camera usage description in Info.plist as bellow. Ignore this step if you have added those.

  4. Refer to demo project to see how to use the SDK.

Swift package manager

  1. Download the AAILivenessSDK SPM package, then unzip it.

  2. In Xcode, select Project -> Package Dependencies -> Add Local..., then select the AAILivenessUI folder of unzipped folder.

  3. Add camera usage description in Info.plist as bellow. Ignore this step if you have added those.

  4. Refer the demo project LivenessSDKSwiftDemo_SPM of the unzipped folder to see how to use the SDK.

Carthage

  1. Add the following lines to your Cartfile:

  2. Run carthage update --platform iOS --use-xcframeworks to download the SDK.

  3. Add the AAILivenessSDK.xcframework, AAILivenessUI.xcframework, AAILivenessModel.xcframework, AAINetwork.xcframework, AAICore.xcframework, AAIDataVisor.xcframework of Carthage/Build folder to the Frameworks, Libraries, and Embedded Content section in the General settings tab of your application targets. Note Embed & Sign should be selected.

  4. Add camera usage description in Info.plist as bellow. Ignore this step if you have added those.

  5. Download the demo project LivenessSDKSwiftDemo_Carthage to see how to use the SDK.

Manually

  1. Download the AAILivenessSDK, AAILivenessModel, AAINetwork, AAICore, AAIDataVisor then uncompress them and add AAILivenessSDK folder, AAILivenessModel.xcframework, AAINetwork.xcframework, AAICore.xcframework, AAIDataVisor.xcframework to your project:

  2. Choose "TARGETS -> General" add the following system libraries and frameworks in the Frameworks, Libraries, and Embedded Content section:

    • libz.tbd
    • libc++.tbd
    • libresolv.9.tbd
    • AVFoundation.framework
    • CoreMotion.framework
    • SystemConfiguration.framework
    • CoreTelephony.framework
    • Accelerate.framework
    • Metal.framework
    • MetalKit.framework
  3. Choose "TARGETS -> General -> Frameworks,Libraries,and Embedded Content", then set AAILivenessSDK.xcframework, AAILivenessModel.xcframework, AAINetwork.xcframework, AAICore.xcframework, AAIDataVisor.xcframework's Embed as "Embed & Sign".

  4. Add -ObjC to the other linker flag in the project configuration.

  5. Add camera usage description in Info.plist as bellow. Ignore this step if you have added those.

Usage

  1. Below are detailed usage examples for the iOS SDK. We place the iOS SDK sample code inside a button click handler. This is the recommended practice for the iOS SDK, keeping it compact, clear, less prone to missed settings, and helping prevent errors. For available liveness types, see Liveness types.

Error code

See error code for all possible values of errorCode in AAILivenessFailureResult.

FAQ

See FAQ

Change logs and release history

See iOS liveness SDK release history