> 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.
...
...
@@ -11,6 +12,11 @@ import account_appAccount from '@ohos.account.appAccount';
```
## System Capabilities
SystemCapability.Account.AppAccount
## account_appAccount.createAppAccountManager
createAppAccountManager(): AppAccountManager;
...
...
@@ -29,13 +35,13 @@ Creates an **AppAccountManager** instance.
Adds an application account and its additional information to the account management service. This method uses an asynchronous callback to return the result.
Adds an app account and its additional information to the account management service. This method uses an asynchronous callback to return the result.
| name | string | Yes| Name of the application account to add.|
| extraInfo | string | Yes| Additional information (for example, token) of the application account to add. The additional information cannot contain sensitive information about the application account.|
| callback | AsyncCallback<void> | Yes| Callback invoked when the application account and its additional information are added.|
| 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.|
Adds an application account and its additional information to the account management service. This method uses a promise to return the result asynchronously.
Adds an app account and its additional information to the account management service. This method uses a promise to return the result.
| name | string | Yes| Name of the application account to add.|
| extraInfo | string | Yes| Additional information of the application account to add. The additional information cannot contain sensitive information about the application account.|
| 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.|
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.
Disables the specified third-party application account from accessing the third-party application with the given bundle name. This method uses an asynchronous callback to return the result.
Disables an app account from accessing an application with the given bundle name. This method uses an asynchronous callback to return the result.
| name | string | Yes| Name of the third-party application account.|
| bundleName | string | Yes| Bundle name of the third-party application.|
| callback | AsyncCallback<void> | Yes| Callback invoked when the third-party application account is disabled from accessing the third-party application with the given bundle name.|
| name | string | Yes| App account name.|
| 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.|
- Example
...
...
@@ -192,14 +239,14 @@ Disables the specified third-party application account from accessing the third-
Disables the specified third-party application account from accessing the third-party application with the given bundle name. This method uses a promise to return the result asynchronously.
Disables an app account from accessing an application with the given bundle name. This method uses a promise to return the result.
Enables the specified third-party application account to access the third-party application with the given bundle name. This method uses an asynchronous callback to return the result.
Enables an app account to access an application with the given bundle name. This method uses an asynchronous callback to return the result.
| bundleName | string | Yes| Bundle name of the third-party application.|
| callback | AsyncCallback<void> | Yes| Callback invoked when the third-party application account is enabled to access the third-party application with the given bundle name.|
| name | string | Yes| App account 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.|
- Example
...
...
@@ -245,14 +292,14 @@ Enables the specified third-party application account to access the third-party
Enables the specified third-party application account to access the third-party application with the given bundle name. This method uses a promise to return the result.
Enables an app account to access an application with the given bundle name. This method uses a promise to return the result.
Checks whether the specified application account allows application data synchronization. This method uses an asynchronous callback to return the result.
Checks whether an app account allows application data synchronization. This method uses an asynchronous callback to return the result.
The **ohos.permission.DISTRIBUTED_DATASYNC** permission is required. This permission is intended for system applications only.
...
...
@@ -282,8 +329,8 @@ The **ohos.permission.DISTRIBUTED_DATASYNC** permission is required. This permis
Checks whether the specified application account allows application data synchronization. This method uses a promise to return the result asynchronously.
Checks whether an app account allows application data synchronization. This method uses a promise to return the result.
The **ohos.permission.DISTRIBUTED_DATASYNC** permission is required. This permission is intended for system applications only.
...
...
@@ -307,7 +354,7 @@ The **ohos.permission.DISTRIBUTED_DATASYNC** permission is required. This permis
| Name| Type| Mandatory| Description|
| ------ | ------ | ---- | -------------- |
| name | string | Yes| Application account name.|
| name | string | Yes| App account name.|
- Return value
...
...
@@ -330,16 +377,16 @@ The **ohos.permission.DISTRIBUTED_DATASYNC** permission is required. This permis
| isEnable | boolean | Yes| Specifies whether to enable application data synchronization.|
| callback | AsyncCallback<void> | Yes| Callback invoked when application data synchronization is enabled or disabled for the application account.|
| name | string | Yes| App account name.|
| isEnable | boolean | Yes| Whether to enable app data synchronization.|
| callback | AsyncCallback<void> | Yes| Callback invoked when application data synchronization is enabled or disabled for the app account.|
- Example
...
...
@@ -463,7 +510,7 @@ The **ohos.permission.DISTRIBUTED_DATASYNC** permission is required. This permis
| owner | string | Yes| Owner of a system application account or third-party application account.|
| callback | AsyncCallback<Array<AppAccountInfo>> | Yes| Callback invoked to return information about all accounts of the specified account owner.|
| owner | string | Yes| Bundle name of the app.|
| callback | AsyncCallback<Array<AppAccountInfo>> | Yes| Callback invoked to return information about all app accounts.|
- Example
...
...
@@ -784,7 +831,7 @@ The **ohos.permission.GET_ACCOUNTS_PRIVILEGED** permission is required. This per
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 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.
>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.
## Modules to Import<a name="s56d19203690d4782bfc74069abb6bd71"></a>
...
...
@@ -9,6 +10,12 @@
import account_distributedAccount from '@ohos.account.distributedAccount';