# Visionkit-SampleCode-interactiveLivenessDemo-ArkTS **Repository Path**: rekirt/visionkit-sample-code-arkts ## Basic Information - **Project Name**: Visionkit-SampleCode-interactiveLivenessDemo-ArkTS - **Description**: 本示例展示了人脸活体检测能力、卡证识别能力和文档扫描能力。 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 5 - **Created**: 2025-09-01 - **Last Updated**: 2025-10-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Face Liveness Detection Control ## Overview This sample code illustrates how to use the face liveness detection capability among the visual AI capabilities. It simulates how to redirect to the face liveness detection control, obtain the detection result, and display the result. You need to use **@hms.ai.interactiveLiveness.d.ts**, which contains the APIs for face liveness detection. ## Preview | **App home screen** | **Starting detection** | **Success message** | **Failure message** | **Detection success result** | **Detection failure result** | |:------------------------:|:-----------------------------------------:|:----------------------------:|:---------------------------:|:---------------------------:|:---------------------------------:| | ![](screenshots/app_en.png) | ![](screenshots/interactionDetection_en.png) | ![](screenshots/success_en.png) | ![](screenshots/failed_en.png) | ![](screenshots/resultSuccess_en.png) | ![](screenshots/resultFailed_en.png) | Instructions: 1. On the home screen of a mobile phone, tap **faceDetectionDemo** to start the app. 2. Tap **Start detection** to access the face liveness detection control. 3. The detection result is displayed on the screen after the detection is complete. ## Project Directory ``` ├─entry/src/main/ets // Code area │ ├─entryability │ │ └─EntryAbility.ets // Entry ability │ └─pages │ └─Index.ets // Home page └─screenshots // Screenshot ``` ## How to Implement The APIs for the face liveness detection control in this sample have been defined in **@hms.ai.interactiveLiveness.d.ts**. ```ts function startLivenessDetection(config: InteractiveLivenessConfig): Promise; function getInteractiveLivenessResult(): Promise; ``` Before using the service, you need to import **interactiveLiveness**. Call the face liveness detection API and receive the processing result. For details, please refer to **entry/src/main/ets/pages/Index.ets**. ## Required Permissions ohos.permission.CAMERA ## Dependencies N/A ## Constraints 1. The sample app is only supported on Huawei phones and tablets with standard systems. 2. The HarmonyOS version must be HarmonyOS NEXT Developer Beta1 or later. 3. The DevEco Studio version must be DevEco Studio NEXT Developer Beta1 or later. 4. The HarmonyOS SDK version must be HarmonyOS NEXT Developer Beta1 SDK or later.