Minimum Android version:4.4 (API Level:19)
Compilation Android SDK version:API Level:35
Supported CPU architectures:armeabi-v7a,arm64-v8a
Use-permissions:
<uses-feature android:name="android.hardware.camera" /><uses-permission android:name="android.permission.INTERNET" /><uses-permission android:name="android.permission.CAMERA" />iOS 12.0arm64~0.7MNSCameraUsageDescriptionIf you previously integrated using the source code method, please switch to dependency integration and refer to the migration document.
Add pub spec.yaml dependency
dependencies iqc_plugin^1.4.1 For the Android platform,set the largeHeap property to true (strongly recommended)
<application android:largeHeap="true" />
For the iOS platform,the following configurations need to be added:
Add camera usage description in Info.plistas below. Ignore this step if you have added those
<key>NSCameraUsageDescription</key> <string>Your description</string>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 'AAIGlobalIQASDK', :http => 'https://prod-guardian-cv.oss-ap-southeast-5.aliyuncs.com/sdk/iOS-global-IQA/1.4.0/iOS-GlobalIQA-SDK-V1.4.0.tar.bz2', typetbz
# Optional dependency pod 'AAIGlobalIQAUI', :http => 'https://prod-guardian-cv.oss-ap-southeast-5.aliyuncs.com/sdk/iOS-global-IQA/1.4.0/iOS-GlobalIQA-UI-V1.4.0.tar.bz2', typetbz
# Optional dependency pod 'AAIGlobalIQAModel', :http => 'https://prod-guardian-cv.oss-ap-southeast-5.aliyuncs.com/sdk/iOS-libraries/AAIGlobalIQAModel/1.0.0/AAIGlobalIQAModel-V1.0.0.tar.bz2', typetbz
pod 'AAINetwork', :http => 'https://prod-guardian-cv.oss-ap-southeast-5.aliyuncs.com/sdk/iOS-libraries/AAINetwork/AAINetwork-V1.0.4.tar.bz2', typetbz
pod 'AAICore', :http => 'https://prod-guardian-cv.oss-ap-southeast-5.aliyuncs.com/sdk/iOS-libraries/AAICore/1.0.1/AAICore-V1.0.1.tar.bz2', typetbzendDeclare the plugin.
import 'package:iqc_plugin/iqc_plugin.dart';Initialize the SDK.
void main() {WidgetsFlutterBinding.ensureInitialized();GlobalIQCPlugin.initialize();runApp(MyApp());}
Get the SDK version number.
GlobalIQCPlugin.getSDKVersion.then((sdkVersion) { print(sdkVersion);});Check license
The license is obtained by your server calling our openAPI, you need to check license before starting the IQA activity.
String license = "xxx";String? result = await GlobalIQCPlugin.setLicenseAndCheck(license);
print("result = " + result.toString());if ("SUCCESS" == result) { startGlobalIQCDetection();}
The returned values of checkResult:
APPLICATION_ID_NOT_MATCH: The package name is not within the authorized scope, please check your package name.
LICENSE_EXPIRE: The license has expired, please confirm that the user has calibrated the phone time.
ERROR_LICENSE(1): The license parsing succeeded, but necessary authentication information is missing, this case generally will not occur.
ERROR_LICENSE(2): The license parsing succeeded, but the internal format is incorrect, this case also generally will not occur.
ERROR_LICENSE(3): It is highly likely that an incompatible SDK license is being used, such as using an IQA license for liveness detection.
ERROR_LICENSE(4, 5): Parsing failed, please check if the license has issues like mismatched quotes, line breaks, etc.User binding (highly recommended).
You can use this method to pass us your unique user ID, and we will establish a mapping relationship based on that ID. It's easy to track logs with us in case of problems.
GlobalIQCPlugin.bindUser("UserId"); Start and Get Results
We provide two ways to get images and detection results, you can get them directly through the SDK or you can request the results via IDVID.
void startGlobalIQCDetection() {GlobalIQCPlugin.startGlobalIQC(this, {"region": "ID","cardType": "ID_CARD","cardSide": "FRONT","mode": "DEFAULT","pageColor": "#ffffff","primaryTextColor": "#ffffff","frameRectColor": "#00ffff","frameRectCornerRadius": 20,"titleBackgroundColor": "#00ff00","flipCameraBtnVisible": true,"lightBtnVisible": true,"tipIconVisible": true,"titleTextColor": "#0000ff","cameraWidthPercentInPortraitState": 0.8,"cameraHeightPercentInLandscapeState": 0.7,"retakeBtnTextColor": "#ff00ff","continueBtnTextColor": "#00ff00","takePhotoTipDialogShowSeconds": 5,"scanLimitSeconds": 30,"countdownTimerVisible": true,"takePhotoTipViewLeftIconVisible": true,"takePhotoTipViewBackgroundColor": "#ffffff","screenOrientation": "PORTRAIT","portraitTipConfig":"{\"viewWidthPercentRelativeToCameraView\": 1, \"aspectRatio\": 0.3}","landscapeTipConfig":"{\"viewWidthPercentRelativeToCameraView\": 0.3, \"aspectRatio\": 0.1}"});}@overridevoid onGetGlobalIQCResult(bool isSuccess, Map<dynamic, dynamic>? resultMap) {print("IQCPlugin onGetDetectionResult isSuccess:" + isSuccess.toString());print("IQCPlugin onGetDetectionResult print result:" + resultMap.toString());}