###Demo
Install CV-Demo.apk to your phone and log in with the test account.
###Integrate the plugin into your project
Click to download GlobalIQAPlugin
Unzip and add the GlobalIQAPlugin
plugin to your project
xxxxxxxxxx
ionic cordova plugin add GlobalIQAPlugin
open/.../your-project-name/platforms/android/app/build.gradle
add these dependencies:
xxxxxxxxxx
repositories {
maven {
url 'https://public-n3.advai.net/repository/maven-releases/'
}
}
dependencies {
implementation fileTree(dir: 'libs', include: '*.aar')
// SUB-PROJECT DEPENDENCIES START
implementation(project(path: ":CordovaLib"))
compile "com.android.support:support-annotations:27.+"
// SUB-PROJECT DEPENDENCIES END
...
// Add the following line of dependencies
// Version history see:
// http://public-n3.advai.net/repository/maven-releases/ai/advance/mobile-sdk/android/global-iqa/maven-metadata.xml
implementation 'ai.advance.mobile-sdk.android:global-iqa:1.2.8'
}
###Quick Start
Initialization SDK
xxxxxxxxxx
cordova.plugins.GlobalIQAPlugin.initSDK()
Check License
The license is obtained by your server calling our openAPI, you need to check license before starting the activity.
xxxxxxxxxx
cordova.plugins.GlobalIQAPlugin.setLicenseAndCheck("your license",success callback,error callback)
SDK log output switch
xxxxxxxxxx
cordova.plugins.GlobalIQAPlugin.setLogEnable(true)
User binding (strongly recommended).
You can use this method to pass your user unique identifier to us, we will establish a mapping relationship based on the identifier。It is helpful for us to check the log when encountering problems.
xxxxxxxxxx
cordova.plugins.GlobalIQAPlugin.bindUser('your unique userId')
Start the detection page and obtain the check result.
Each time the detection is successful, a unique IDVID and a clear photo will be returned.
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.
xxxxxxxxxx
// After the detection is over, we will return the detection results immediately
const extras : object = { region: "ID", cardType: "ID_CARD",cardSide:"FRONT"}
cordova.plugins.GlobalIQAPlugin.startGlobalIQADetection(extras,result=>{
alert(result)
}) // You can also call getResultData function at other times after detection is completed to get the result. cordova.plugins.GlobalIQAPlugin.getResultData(result=>{ alert(result) })
With extras you can customize UI elements, here's an example
xxxxxxxxxx
const extras : object =
{
region:"ID",// required,Regional ISO codes, use either 2 or 3 digit short codes
cardType:"ID_CARD", // required,Card type, enumeration value:ID_CARD,DRIVING_LICENSE,UMID,SSS,TIN,PASSPORT,VOTERID,NATIONALID,PRC,PAGIBG,POSTALID
cardSide:"FRONT",// required,Card front and back, enumerated values:FRONT,BACK
soundPlayEnable:true,// Whether the sound broadcast is on, the default is on
pageColor:"#ffffff",// Page main color
primaryTextColor:"#000000",// Page main text color
frameRectColor:"#000000",// The color of the camera mask layer
titleBackgroundColor:"#ffffff",// Color of the title bar
flipCameraBtnVisible:true,// Whether the flip camera button is visible,default is true
lightBtnVisible:true,// Whether the flashlight button is visible, the default is visible
tipIconVisible:true,// Whether the small icon of the bottom prompt control is visible during vertical scanning
titleTextColor:"#000000",// The text color of title bar
cameraWidthPercentInPortraitState:0.8,// The width percent of camera view when the page at portrait state,the value must between [0,1]
cameraHeightPercentInLandscapeState:0.7,// The width percent of camera view when the page at landscape state,the value must between [0,0.7]
retakeBtnTextColor:"#000000",// The retake button text color in 'Take Photo' mode
continueBtnTextColor:"#000000",// The continue button text color in 'Take Photo' mode
takePhotoTipDialogShowSeconds:5,// The tip dialog(when scanning timeout) duration seconds, set to 0 will not show the dialog
scanLimitSeconds:20,// The scanning seconds limit,the value must between [5,60]
countdownTimerVisible:true,// Whether the countdown timer view shown
screenOrientation:"AUTO" // Lock screen orientation, default adaptive rotation direction, enumerated values: LANDSCAPE, PORTRAIT, AUTO
}
A success result sample of [Global Document Verification]
xxxxxxxxxx
{
"success":true,
"image":"\/9j\/4AAQSk...",
"IDVID":"31262ac6-8b3a-4a30-96c1-3d4ca5b0d3ed",
"isPay":true,
"transactionId":"58358c2e8894de35",
"ocrResult":{
"idNumber":"000000000000",
"fullName":"XXX",
"expiryDate":"XXX",
"state":"XXX",
"city":"XXX",
"district":"XXX",
"subdistrict":"XXX",
"fullAddress":"XXX",
"gender":"XXX",
"religion":"XXX",
"nationality":"XXX",
"others":{
"occupation":"XXX",
"maritalStatus":"XXX"
}
},
"idForgeryResult":{
"result":"pass",
"data":"valid"
},
"pictureType":"scan"
}
A success result sample of [Global Image Quality Check]
xxxxxxxxxx
{
"success":true,
"image":"\/9j\/4AAQSk...",
"IDVID":"31262ac6-8b3a-4a30-96c1-3d4ca5b0d3ed",
"isPay":true,
"transactionId":"58358c2e8894de35",
"pictureType":"scan"
}
Multilingual
SDK supports three languages, English, Indonesian and Chinese, switching automatically with the cellphone system language.
If the SDK does not automatically switch with the system language, please check your cellphone language settings and make sure that both [Region] and [Language] are switched to the corresponding language.
If it still have problems with multiple languages and the app only supports one language, you can filter out the unwanted languages by adding the following configuration to build.gradle
xxxxxxxxxx
android {
defaultConfig {
...
resConfigs("in-rID") // For example, only Indonesian is supported
}
}
Runtime Permissions
This SDK requires the following permissions, which have been configured in the aar manifest file and the SDK itself is ready for dynamic application of Android 6.0+ permissions.
xxxxxxxxxx
<uses-feature android:name="android.hardware.camera" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
Code proguard configuration
The SDK already has code proguard, no additional configuration is required.
SDK Compatibility
armeabi-v7a
,arm64-v8a
,x86
,x86_64
,armeabi