Frontend Integration(Flutter SDK)

A Solution Flutter plugin for iOS and Android.

Overview

Android

  • Minimum Android version:4.4 (API Level:19)
  • Compilation Android SDK version:API Level:34
  • Supported CPU architectures:armeabi-v7aarm64-v8a
  • SDK incremental package size: ~0.9MB
  • Use-permissions:
    <uses-feature android:name="android.hardware.camera" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.CAMERA" />

iOS

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

pub.dev dependency

  1. Add pub spec.yaml dependency

    dependencies: solution_plugin: ^1.1.2
  2. For the iOS platform,the following configurations need to be added:

    1. Add camera usage description in Info.plistas below. Ignore this step if you have added those

      <key>NSCameraUsageDescription</key> <string>Use the camera to detect the face movements</string>
    2. Add the following code to the podfile file in your project

      target 'Runner' do flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) pod 'SolutionH5', :http => 'https://prod-guardian-cv.oss-ap-southeast-5.aliyuncs.com/sdk/iOS-Solution-SDK/1.1.2/iOS-SolutionH5-V1.1.2.tar.bz2', type: :tbz end

Quick Start

  1. Declare the plugin.

    import 'package:solution_plugin_alpha/env.dart'; import 'package:solution_plugin_alpha/region.dart'; import 'package:solution_plugin_alpha/solution_plugin.dart'; import 'package:solution_plugin_alpha/solution_result.dart';
  2. Get the SDK version number.

    SolutionPlugin.getSDKVersion.then((sdkVersion) { print(sdkVersion); });
  3. Start a h5 page.

    // Sample code class _SomePageState extends State<SomePage> { ... void start() { SolutionPlugin.startByUrl( "url", // The url you obtained from your server. ).then((value) => { print("solution result: " + value.toString()),// sample value: {"code": "FINISH","signatureId": "6f1188513f30c827"} }); } }

Language Support

Currently, the SDK supports the following languages:

  • English
  • Indonesian // coming soon
  • Chinese //coming soon

Code

CodeDescription
BROWSER_ISSUENot supported due to compatibility issues
DOCUMENT_AUTO_SCAN_TRY_COUNT_EXCEEDDocument auto-scan try count exceeded the limit
DOCUMENT_MANUAL_TRY_COUNT_EXCEEDDocument manual photo try count exceeded the limit
NO_PERMISSIONNo camera permission
CAMERA_ISSUECamera issue error
RESELECT_DOC_TYPEUser clicked to reselect document type
LIVENESS_TRY_COUNT_EXCEEDLiveness detection try count exceeded the limit
NOT_SUPPORTBrowser not supported
USER_GIVE_UPUser gives up
NETWORK_ERROREetwork error
UNDEFINEDUndefind error
FINISHThe process was finished.
ERRORServer error
EMPTY_PARAMETER_ERRORParameter should not be empty
INSUFFICIENT_BALANCEInsufficient balance, please top up or contact your sales manager for help
SERVICE_BUSYRate limit is exceeded, please retry after 10s
Quota exceeded: You have exceeded the daily quota for free queries, please contact out tech support for help
IAM_FAILEDAccess denied.
PARAMETER_ERRORError parameter
OVER_QUERY_LIMITYou have exceeded free query quota
CLIENT_ERRORHTTP client error,If you get this error, please check the API document or contact our tech support for help.
RETRY_LATERQuery failed, please retry after 10s
INVALID_URLInvalid URL, please check the URL format.

Did this page help you?