From b634aff4926cdbe79a4e20b79b541259bcc02367 Mon Sep 17 00:00:00 2001 From: Annie_wang Date: Mon, 26 Sep 2022 17:54:15 +0800 Subject: [PATCH] update docs Signed-off-by: Annie_wang --- .../reference/apis/Readme-EN.md | 1 + .../apis/js-apis-useriam-faceauth.md | 81 +++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 en/application-dev/reference/apis/js-apis-useriam-faceauth.md diff --git a/en/application-dev/reference/apis/Readme-EN.md b/en/application-dev/reference/apis/Readme-EN.md index fe77dc5347..e580b6bbef 100644 --- a/en/application-dev/reference/apis/Readme-EN.md +++ b/en/application-dev/reference/apis/Readme-EN.md @@ -146,6 +146,7 @@ - [@ohos.privacyManager](js-apis-privacyManager.md) - [@ohos.security.huks ](js-apis-huks.md) - [@ohos.userIAM.userAuth ](js-apis-useriam-userauth.md) + - [@ohos.userIAM.faceAuth](js-apis-useriam-faceauth.md) - [@system.cipher](js-apis-system-cipher.md) - Data Management diff --git a/en/application-dev/reference/apis/js-apis-useriam-faceauth.md b/en/application-dev/reference/apis/js-apis-useriam-faceauth.md new file mode 100644 index 0000000000..6069032794 --- /dev/null +++ b/en/application-dev/reference/apis/js-apis-useriam-faceauth.md @@ -0,0 +1,81 @@ +# Facial Authentication + +The **userIAM.faceAuth** module provides APIs for face enrollment. + +> **NOTE** +> +> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. +> +> The APIs provided by this module are system APIs. + +## Modules to Import + +```js +import userIAM_faceAuth from '@ohos.userIAM.faceAuth'; +``` + +## FaceAuthManager + +Provides APIs for facial authentication management. + +### constructor + +constructor() + +A constructor used to create a **FaceAuthManager** object. + +**System capability**: SystemCapability.UserIAM.UserAuth.FaceAuth + +**Return value** + +| Type | Description | +| ---------------------- | -------------------- | +| [FaceAuthManager](#faceauthmanager) | **FaceAuthManager** object.| + +**Example** + + ```js + import userIAM_faceAuth from '@ohos.userIAM.faceAuth'; + + let faceAuthManager = new userIAM_faceAuth.FaceAuthManager() + ``` + +### setSurfaceId + +setSurfaceId(surfaceId: string): ResultCode; + +Sets an [XComponent surface ID](../arkui-ts/ts-basic-components-xcomponent.md#getxcomponentsurfaceid) for the face preview page in the face enrollment process. + +**System capability**: SystemCapability.UserIAM.UserAuth.FaceAuth + +**Parameters** + +| Name | Type | Mandatory| Description | +| -------------- | ---------------------------------- | ---- | -------------------------- | +| surfaceId | string | Yes | ID of the surface held by the [XComponent](../arkui-ts/ts-basic-components-xcomponent.md#getxcomponentsurfaceid).| + +**Return value** + +| Type | Description | +| ---------- | ------------------------------------------------------------ | +| [ResultCode](#resultcode) | Operation result code.| + +**Example** + + ```js + import userIAM_faceAuth from '@ohos.userIAM.faceAuth'; + + let faceAuthManager = new userIAM_faceAuth.FaceAuthManager() + faceAuthManager.setSurfaceId("0"); + ``` + +## ResultCode + + Enumerates the operation result codes. + + **System capability**: SystemCapability.UserIAM.UserAuth.FaceAuth + +| Name | Default Value| Description | +| ----------------------- | ------ | -------------------- | +| SUCCESS | 0 | The operation is successful. | +| FAIL | 1 | The operation fails. | -- GitLab