Provides app account management, including adding, deleting, querying, modifying, and authorizing app accounts, writing data to disks, and synchronizing data.
> **NOTE**<br>
> **NOTE**<br>
> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
...
@@ -20,13 +22,14 @@ Creates an **AppAccountManager** instance.
...
@@ -20,13 +22,14 @@ Creates an **AppAccountManager** instance.
Adds an app account and its additional information to the account management service. This method uses an asynchronous callback to return the result.
Adds the account name and additional information (information that can be converted into the string type, such as token) of this app to the **AppAccountManager** service. This API uses an asynchronous callback to return the result.
| name | string | Yes | Name of the app account to add. |
| name | string | Yes | Name of the app account to add. |
| extraInfo | string | Yes | Additional information (for example, token) of the app account to add. The additional information cannot contain sensitive information about the app account. |
| extraInfo | string | Yes | Additional information to add. The additional information cannot contain sensitive information, such as the app account password.|
| callback | AsyncCallback<void> | Yes | Callback invoked when the app account and its additional information are added. |
| callback | AsyncCallback<void> | Yes | Callback invoked when the app account name and additional information are added. |
**Example**
**Example**
...
@@ -86,24 +89,24 @@ Adds an app account and its additional information to the account management ser
...
@@ -86,24 +89,24 @@ Adds an app account and its additional information to the account management ser
Adds an app account and its additional information to the account management service. This method uses a promise to return the result.
Adds the account name and additional information (information that can be converted into the string type, such as token) of this app to the **AppAccountManager** service. This API uses a promise to return the result.
| name | string | Yes | Name of the app account to add. |
| name | string | Yes | Name of the app account to add. |
| extraInfo | string | Yes | Additional information of the app account to add. The additional information cannot contain sensitive information about the app account. |
| extraInfo | string | Yes | Additional information to add. The additional information cannot contain sensitive information, such as the app account password.|
**Return Value**
**Return Value**
| Type | Description |
| Type | Description |
| ------------------- | --------------------- |
| ------------------- | --------------------- |
| Promise<void> | Promise used to return the result. |
| Promise<void> | Promise used to return the result.|
**Example**
**Example**
...
@@ -120,18 +123,18 @@ Adds an app account and its additional information to the account management ser
...
@@ -120,18 +123,18 @@ Adds an app account and its additional information to the account management ser
Implicitly adds an app account based on the specified account owner, authentication type, and options. This method uses an asynchronous callback to return the result.
Implicitly adds an app account based on the specified account owner, authentication type, and options. This API uses an asynchronous callback to return the result.
| name | string | Yes | Name of the target app account. |
| bundleName | string | Yes | Bundle name of an app. |
| bundleName | string | Yes | Bundle name of the app. |
| callback | AsyncCallback<void> | Yes | Callback invoked when the app account is disabled from accessing the application with the given bundle name. |
| callback | AsyncCallback<void> | Yes | Callback used to return the result.|
**Example**
**Example**
...
@@ -241,22 +244,22 @@ Disables an app account from accessing an application with the given bundle name
...
@@ -241,22 +244,22 @@ Disables an app account from accessing an application with the given bundle name
| name | string | Yes | Name of the target app account. |
| bundleName | string | Yes | Bundle name of an app. |
| bundleName | string | Yes | Bundle name of an app. |
| callback | AsyncCallback<void> | Yes | Callback invoked when the app account is enabled to access the application with the given bundle name. |
| callback | AsyncCallback<void> | Yes | Callback used to return the result.|
**Example**
**Example**
...
@@ -298,22 +301,22 @@ Enables an app account to access an application with the given bundle name. This
...
@@ -298,22 +301,22 @@ Enables an app account to access an application with the given bundle name. This
Obtains the credential of an app account. This method uses an asynchronous callback to return the result.
Obtains the credentials (such as the digital password, face image, and PIN) of an app account. This API uses an asynchronous callback to return the result.
Obtains additional information of an app account. This method uses an asynchronous callback to return the result.
Obtains additional information (information that can be converted into the string type) about an app account. This API uses an asynchronous callback to return the result.
| type | 'change' | Yes | Type of the event to subscribe to. The subscriber will receive a notification when the account owners update their accounts. |
| type | 'change' | Yes | Account change events to subscribe to. The subscriber will receive a notification when the account owners update their accounts.|
| owners | Array<string> | Yes | Owners of the accounts. |
Obtains the OAuth access token of an app account based on the specified authentication type. This method uses an asynchronous callback to return the result.
Obtains the OAuth token of an app account based on the specified authentication type. This API uses an asynchronous callback to return the result.
| bundleName | string | Yes | Bundle name of the app. |
| bundleName | string | Yes | Bundle name of the app. |
| isVisible | boolean | Yes | Whether the OAuth access token is visible to the app. |
| isVisible | boolean | Yes | Whether the OAuth token is visible to the app. The value **true** means visible, and the value **false** means the opposite.|
| callback | AsyncCallback<void> | Yes | Callback invoked to return the result. |
| callback | AsyncCallback<void> | Yes | Callback invoked to return the result. |
**Example**
**Example**
...
@@ -1224,24 +1227,24 @@ Sets the visibility of an OAuth access token to the specified app. This method u
...
@@ -1224,24 +1227,24 @@ Sets the visibility of an OAuth access token to the specified app. This method u
Obtains information about all OAuth access tokens of an app account visible to the specified app. This method uses an asynchronous callback to return the result.
Obtains all OAuth tokens visible to the caller for an app account. This API uses an asynchronous callback to return the result.