Flutter SDK Integration
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-v7a
,arm64-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
-
Add pub spec.yaml dependency
dependencies: solution_plugin: ^1.0.0
-
For the iOS platform,the following configurations need to be added:
-
Add camera usage description in
Info.plist
as below. Ignore this step if you have added those<key>NSCameraUsageDescription</key> <string>Use the camera to detect the face movements</string>
-
Add the following code to the
podfile
file in your projecttarget '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.0.0/iOS-SolutionH5-V1.0.0.tar.bz2', type: :tbz end
-
Quick Start
-
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';
-
Get the SDK version number.
SolutionPlugin.getSDKVersion.then((sdkVersion) { print(sdkVersion); });
-
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": "SUCCESS","signatureId": "6f1188513f30c827"} }); } }
Language Support
Currently, the SDK supports the following languages:
- English
- Indonesian // coming soon
- Chinese //coming soon
Code
Code | Description |
---|---|
BROWSER_ISSUE | Not supported due to compatibility issues |
DOCUMENT_AUTO_SCAN_TRY_COUNT_EXCEED | Document auto-scan try count exceeded the limit |
DOCUMENT_MANUAL_TRY_COUNT_EXCEED | Document manual photo try count exceeded the limit |
NO_PERMISSION | No camera permission |
CAMERA_ISSUE | Camera issue error |
RESELECT_DOC_TYPE | User clicked to reselect document type |
LIVENESS_TRY_COUNT_EXCEED | Liveness detection try count exceeded the limit |
NOT_SUPPORT | Browser not supported |
LIVENESS_ATTACK | The liveness detection result < 50.0. |
SIMILARITY_FAIL | The faceSimilarityScore < 70.0. |
USER_GIVE_UP | User gives up |
NETWORK_ERROR | Eetwork error |
UNDEFINED | Undefind error |
SUCCESS | The process was completed successfully. |
ERROR | Server error |
EMPTY_PARAMETER_ERROR | Parameter should not be empty |
INSUFFICIENT_BALANCE | Insufficient balance, please top up or contact your sales manager for help |
SERVICE_BUSY | Rate 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_FAILED | Access denied. |
PARAMETER_ERROR | Error parameter |
OVER_QUERY_LIMIT | You have exceeded free query quota |
CLIENT_ERROR | HTTP client error,If you get this error, please check the API document or contact our tech support for help. |
RETRY_LATER | Query failed, please retry after 10s |
INVALID_URL | Invalid URL, please check the URL format. |
Updated 21 days ago