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" />Set the largeHeap property to true (strongly recommended)
<application android:largeHeap="true" />iOS 12.0arm64~0.7MNSCameraUsageDescriptionIf you previously integrated using the source code method, please switch to dependency integration and refer to the migration document.
Click to view the compliance explanation
Add pub package.json dependency
"dependencies": "iqa-plugin-cordova""1.4.2",Initialization SDK.
const iqa = cordova.plugins.iqa;iqa.initSDK(() => {}, (error) => {})Check license
The license is obtained by your server calling our openAPI, you need to check license before starting the liveness detection activity.
const license = "xxx";iqa.setLicenseAndCheck(iqaLicense, (result) => {if (result !== 'SUCCESS') {showMessage(`IQA License Check Failed: ${result}`, 'error');return;}const iqaParams = {};iqa.startGlobalIQC(iqaParams, (res) => {displayIqaResult(res);}, (err) => {console.error("IQA : Detection Failed.", err);});}, (err) => {console.error("IQA: License Set Failed.", err);});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.
You can create SDK launch parameters using the method below. Note that the function below is a complete example, including the SDK initialization and license check mentioned above. You can refer to it directly.
const iqa = cordova.plugins.iqa;const iqaLicense = "Your license";console.log("IQA Step 1: Initializing SDK...");iqa.initSDK(() => {iqa.setLicenseAndCheck(iqaLicense, (result) => {if (result !== 'SUCCESS') {showMessage(`IQA License Check Failed: ${result}`, 'error');return;}const iqaParams = {};iqa.startGlobalIQC(iqaParams, (res) => {displayIqaResult(res);}, (err) => {console.error("IQA : Detection Failed.", err);});}, (err) => {console.error("IQA: License Set Failed.", err);});}, (err) => {console.error("IQA: SDK Init Failed.", err);});