Integration Documentaion(Default UI)

This document explains how to use the default UI component to to quickly achieve the desired functionality.

Installation

CocoaPods

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

  2. Install the dependencies in your project:

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

Swift package manager

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

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

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

    Refer to 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 AAIGlobalIQA.xcframework, AAIGlobalIQAModel.xcframework, AAINetwork.xcframework ,AAICore.xcframeworkof 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 below. Ignore this step if you have added those.

  5. Download the carthage demo project AAIGlobalIQASDKSwiftDemo to see how to use the SDK.

Manually

  1. Download the following SDK and frameworks:

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

    • libc++.tbd
    • libz.tbd
    • AVFoundation.framework
    • CoreGraphics.framework
    • MediaPlayer.framework
    • SystemConfiguration.framework
    • Accelerate.framework
  3. Add camera usage description in Info.plist as below. Ignore this step if you have added those.

Usage

  1. Import SDK and initialize with region and cardType and cardSide:

  2. User binding (Optional, but highly recommended).

    You can use this method to pass us your unique user ID or other reference id, and we will establish a mapping relationship based on that ID. It's easy to track logs with us in case of problems.

  3. Configure SDK license, then show SDK page:

  4. Get detection results.

Customizable UI

Regarding UI customization:

Basic Modifications: If you are using the default UI module (AAIGlobalIQAUI), to adjust colors or styles, simply modify the corresponding fields in uiConfig, or inherit specific UI component classes for more complex styling. Refer to the custom UI examples in the Demo project for usage and effects.

Advanced Customization: If existing UI interfaces are insufficient or complex interaction logic is required, use the core view AAIIQACameraWrapperView provided by the SDK to fully implement UI (examples are also available in the Demo). This approach grants complete control over UI appearance and interaction logic. See this document for how to use AAIIQACameraWrapperView.

The following is the related code for Basic Modifications:

Error code

NameDescription
USER_GIVE_UPUser tapped the back button
DEVICE_NOT_SUPPORTThis device is not supported
CAMERA_PERMISSION_DENIEDPermission to access the camera is not authorized
NETWORK_REQUEST_FAILEDNetwork request failed
CAMERA_OPEN_FAILEDFailed to open camera
MODEL_ERRORFailed to load model
SCAN_TIMEOUTScan timeout. Note this code appears only when you set the operatingMode of AAIGlobalIQAConfig to "AAIIQAOperatingModeScanning".
Other error codeOther error codes from server side