Provides app account management, including adding, deleting, querying, modifying, and authorizing app accounts, writing data to disks, and synchronizing data.
> **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.
...
...
@@ -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. |
| 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. |
| callback | AsyncCallback<void> | Yes | Callback invoked when the app account and its additional information are added. |
| name | string | Yes | Name of the app account to add. |
| 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 name and additional information are added. |
**Example**
...
...
@@ -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. |
| extraInfo | string | Yes | Additional information of the app account to add. The additional information cannot contain sensitive information about the app account. |
| name | string | Yes | Name of the app account to add. |
| extraInfo | string | Yes | Additional information to add. The additional information cannot contain sensitive information, such as the app account password.|
**Return Value**
| Type | Description |
| ------------------- | --------------------- |
| Promise<void> | Promise used to return the result. |
| Type | Description |
| ------------------- | --------------------- |
| Promise<void> | Promise used to return the result.|
**Example**
...
...
@@ -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.
| bundleName | string | Yes | Bundle name of an app. |
| callback | AsyncCallback<void> | Yes | Callback invoked when the app account is disabled from accessing the application with the given bundle name. |
| 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. |
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. |
| owners | Array<string> | Yes | Owners of the accounts. |
| callback | Callback<Array<AppAccountInfo>> | Yes | Callback invoked to return the account change. |
| type | 'change' | Yes | Account change events to subscribe to. The subscriber will receive a notification when the account owners update their 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. |
| 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. |
**Example**
...
...
@@ -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.