Documentation

SDK Integration(iOS)

Overview

  • Minimum iOS version: iOS 12.0
  • Supported CPU architectures: arm64
  • SDK incremental package size: ~0.7M
  • Use-permissions: NSCameraUsageDescription

Installation

  1. Add the content to your podfile.
    source 'https://github.com/advance-ai-mobile/aai-specs.git'
    source 'https://cdn.cocoapods.org/'
    
    target your-target do
    
      pod 'SolutionH5', '1.4.4'
    
    end
  2. run pod install --repo-update

Quick Start

  1. Declare the following permissions in the info.plist
    <key>NSCameraUsageDescription</key>  
    <string>Use the camera to detect the face movements</string>
  2. Sets the appearance mode.
    Options: LIGHT, DARK, FOLLOW_SYSTEM.
    Default: LIGHT.
    SolutionCenter.shared.setDarkThemeType(.FOLLOW_SYSTEM)
  3. Sets the loading color of the page for both light and dark appearance modes.The provided color value must be in ARGB or RGB format. This can be specified as an ARGB hex:
    SolutionCenter.shared.setThemeARGBColor(light: 0xffff0000, dark: 0xff0000ff)
    Alternatively, you can be specified as an RGBA hex:
    SolutionCenter.shared.setThemeRGBAColor(light: 0xffff0000, dark: 0xff0000ff)
  4. Regist listener:
    SolutionCenter.shared.register(listener: SLListener(end: { result in
          print("solution end: \(code)")
          print("solution end: \(String(describing: signatureId))")
          print("solution end: \(String(describing: finishRedirectUrl))")
          print("solution end: \(String(describing: extra))")
                                                              
          guard !result.terminated else {
              // The flow was terminated. You can provide a corresponding prompt based on result.getCode().
              return
          }
                
          if result.code == "FINISH" {
              // The flow finished normally. Process the result.
              if let extraInfo = result.extraInfo,
                 let submissionStatus = extraInfo["submissionStatus"] as? String,
                  submissionStatus == "SUBMITTED" {
                  // KYC data was submitted successfully.
              } else {
                  // Submission failed. At this point, you can get an error code from extraInfo
                  // and implement other logic based on the code, such as re-selecting a document.
              }
          } else {
              // This branch currently only handles the USER_GIVE_UP case.
          }
    }))
  5. Starts the Solution flow. Pass in your own URL and a callback listener to receive the result.
    SolutionCenter.shared.start(with: url)
  6. For detailed return values, please consult the [documentation link].

Release Notes

Click to show release notes