From 4.0.0, we've introduced significant API improvements and feature enhancements. To make upgrading easier, here’s what you need to know:
Some APIs in the table below are now removed. You’ll need to update your code accordingly.
LivenessPlugin| Method/Property | Alternative | Notes |
|---|---|---|
| setActionSequence | - | No need to call. |
| setDetectionLevel | - | No need to call. |
| setVideoConfig | - | No need to call. |
| setAuditConfig | - | No need to call. |
| setDetectOcclusion | - | No need to call. |
| set3DLivenessTimeoutMills | - | No need to call. |
| setActionTimeoutMills | - | No need to call. |
| setResultPictureSize | - | No need to call. |
| bindUser | - | No need to call. |
| setSignatureId | - | No need to call. |
The recommended alternative for the deprecated API is as follows:
xvoid startLivenessDetection() {Map<String, dynamic> config = {"cameraType": CameraType.FRONT,"detectOcclusion": false,"auditImageConfig": {"enableCollectSwitch": true,"imageWidth": 400,"imageQuality": 30,"relativeSecondsCaptureAfterCameraLaunched": 3.0,},"livenessType": "test_more","signatureId": "your_signature_id","distantNearTimeout": 50000,"silentTimeout": 50000,"actionTimeout": 10000,"prepareMillSeconds": 0,"resultPictureSize": 600,"maxRecordVideoSeconds": 600,"userId": "your_unique_user_id","maskColor": "#000000","ovalColor": "#000000","ovalNormalColor": "#000000"};LivenessPlugin.startLivenessDetection(config, this);}
For detailed integration instructions, please refer to the integration documentation.