diff --git a/en/application-dev/reference/apis/js-apis-appAccount.md b/en/application-dev/reference/apis/js-apis-appAccount.md index 3577652546daea30400c7eadafd7e6771a55db77..f7671c4f66025887a62622df895c14b04325eff9 100644 --- a/en/application-dev/reference/apis/js-apis-appAccount.md +++ b/en/application-dev/reference/apis/js-apis-appAccount.md @@ -1,6 +1,6 @@ -# App Account Management +# App Account Management -> **NOTE**
+> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> 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 +20,13 @@ Creates an **AppAccountManager** instance. **System capability**: SystemCapability.Account.AppAccount **Return Value** - | Type | Description | - | ----------------- | ------------ | - | AppAccountManager | **AppAccountManager** instance created. | +| Type | Description | +| ----------------- | ------------ | +| AppAccountManager | **AppAccountManager** instance created.| **Example** ```js - var appAccountManager = account.createAppAccountManager(); + const appAccountManager = account_appAccount.createAppAccountManager(); ``` ## AppAccountManager @@ -37,16 +37,16 @@ Provides methods to manage app accounts. addAccount(name: string, callback: AsyncCallback<void>): void -Adds an app account to the account management service. This method uses an asynchronous callback to return the result. +Adds an app account to the account management service. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Account.AppAccount **Parameters** - | Name | Type | Mandatory | Description | - | -------- | ------------------------- | ---- | --------------------- | - | name | string | Yes | Name of the app account to add. | - | callback | AsyncCallback<void> | Yes | Callback invoked when the app account is added. | +| Name | Type | Mandatory | Description | +| -------- | ------------------------- | ---- | --------------------- | +| name | string | Yes | Name of the app account to add. | +| callback | AsyncCallback<void> | Yes | Callback invoked when the app account is added.| **Example** @@ -61,17 +61,17 @@ Adds an app account to the account management service. This method uses an async addAccount(name: string, extraInfo: string, callback: AsyncCallback<void>): void -Adds an app 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 API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Account.AppAccount **Parameters** - | Name | Type | Mandatory | Description | - | --------- | ------------------------- | ---- | ---------------------------------------- | - | 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 | Type | Mandatory | Description | +| --------- | ------------------------- | ---- | ---------------------------------------- | +| 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. | **Example** @@ -88,22 +88,22 @@ Adds an app account and its additional information to the account management ser addAccount(name: string, extraInfo?: string): Promise<void> -Adds an app account and its additional information to the account management service. This method uses a promise to return the result. +Adds an app account and its additional information to the account management service. This API uses a promise to return the result. **System capability**: SystemCapability.Account.AppAccount **Parameters** - | Name | Type | Mandatory | Description | - | --------- | ------ | ---- | -------------------------------- | - | 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 | Type | Mandatory | Description | +| --------- | ------ | ---- | -------------------------------- | +| 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.| **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 +120,18 @@ Adds an app account and its additional information to the account management ser addAccountImplicitly(owner: string, authType: string, options: {[key: string]: any}, callback: AuthenticatorCallback): void -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. **System capability**: SystemCapability.Account.AppAccount **Parameters** - | Name | Type | Mandatory | Description | - | -------- | --------------------- | ---- | --------------- | - | owner | string | Yes | Bundle name of the app account to add. | - | authType | string | Yes | Authentication type of the app account to add. | - | options | {[key: string]: any} | Yes | Options for the authentication. | - | callback | AuthenticatorCallback | Yes | Authenticator callback invoked to return the authentication result. | +| Name | Type | Mandatory | Description | +| -------- | --------------------- | ---- | --------------- | +| owner | string | Yes | Bundle name of the app account to add.| +| authType | string | Yes | Authentication type of the app account to add. | +| options | {[key: string]: any} | Yes | Options for the authentication. | +| callback | AuthenticatorCallback | Yes | Authenticator callback invoked to return the authentication result.| **Example** @@ -161,16 +161,16 @@ Implicitly adds an app account based on the specified account owner, authenticat deleteAccount(name: string, callback: AsyncCallback<void>): void -Deletes an app account from the account management service. This method uses an asynchronous callback to return the result. +Deletes an app account from the account management service. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Account.AppAccount **Parameters** - | Name | Type | Mandatory | Description | - | -------- | ------------------------- | ---- | ----------------- | - | name | string | Yes | Name of the app account to delete. | - | callback | AsyncCallback<void> | Yes | Callback invoked when the app account is deleted. | +| Name | Type | Mandatory | Description | +| -------- | ------------------------- | ---- | ----------------- | +| name | string | Yes | Name of the app account to delete. | +| callback | AsyncCallback<void> | Yes | Callback invoked when the app account is deleted.| **Example** @@ -185,21 +185,21 @@ Deletes an app account from the account management service. This method uses an deleteAccount(name: string): Promise<void> -Deletes an app account from the account management service. This method uses a promise to return the result. +Deletes an app account from the account management service. This API uses a promise to return the result. **System capability**: SystemCapability.Account.AppAccount **Parameters** - | Name | Type | Mandatory | Description | - | ---- | ------ | ---- | ------------ | - | name | string | Yes | Name of the app account to delete. | +| Name | Type | Mandatory | Description | +| ---- | ------ | ---- | ------------ | +| name | string | Yes | Name of the app account to delete.| **Return Value** - | Type | Description | - | :------------------ | :-------------------- | - | Promise<void> | Promise used to return the result. | +| Type | Description | +| :------------------ | :-------------------- | +| Promise<void> | Promise used to return the result.| **Example** @@ -216,17 +216,17 @@ Deletes an app account from the account management service. This method uses a p disableAppAccess(name: string, bundleName: string, callback: AsyncCallback<void>): void -Disables an app account from accessing an 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 API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Account.AppAccount **Parameters** - | Name | Type | Mandatory | Description | - | ---------- | ------------------------- | ---- | ------------------------------- | - | 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. | +| Name | Type | Mandatory | Description | +| ---------- | ------------------------- | ---- | ------------------------------- | +| 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** @@ -241,22 +241,22 @@ Disables an app account from accessing an application with the given bundle name disableAppAccess(name: string, bundleName: string): Promise<void> -Disables an app account from accessing an application with the given bundle name. This method uses a promise to return the result. +Disables an app account from accessing an application with the given bundle name. This API uses a promise to return the result. **System capability**: SystemCapability.Account.AppAccount **Parameters** - | Name | Type | Mandatory | Description | - | ---------- | ------ | ---- | ----------------- | - | name | string | Yes | App account name. | - | bundleName | string | Yes | Bundle name of an app. | +| Name | Type | Mandatory | Description | +| ---------- | ------ | ---- | ----------------- | +| name | string | Yes | App account name.| +| bundleName | string | Yes | Bundle name of an app. | **Return Value** - | Type | Description | - | :------------------ | :-------------------- | - | Promise<void> | Promise used to return the result. | +| Type | Description | +| :------------------ | :-------------------- | +| Promise<void> | Promise used to return the result.| **Example** @@ -273,17 +273,17 @@ Disables an app account from accessing an application with the given bundle name enableAppAccess(name: string, bundleName: string, callback: AsyncCallback<void>): void -Enables an app account to access an 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 API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Account.AppAccount **Parameters** - | Name | Type | Mandatory | Description | - | ---------- | ------------------------- | ---- | ------------------------------- | - | 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. | +| Name | Type | Mandatory | Description | +| ---------- | ------------------------- | ---- | ------------------------------- | +| 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** @@ -298,22 +298,22 @@ Enables an app account to access an application with the given bundle name. This enableAppAccess(name: string, bundleName: string): Promise<void> -Enables an app account to access an 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 API uses a promise to return the result. **System capability**: SystemCapability.Account.AppAccount **Parameters** - | Name | Type | Mandatory | Description | - | ---------- | ------ | ---- | --------- | - | name | string | Yes | App account name. | - | bundleName | string | Yes | Bundle name of an app. | +| Name | Type | Mandatory | Description | +| ---------- | ------ | ---- | --------- | +| name | string | Yes | App account name. | +| bundleName | string | Yes | Bundle name of an app.| **Return Value** - | Type | Description | - | :------------------ | :-------------------- | - | Promise<void> | Promise used to return the result. | +| Type | Description | +| :------------------ | :-------------------- | +| Promise<void> | Promise used to return the result.| **Example** @@ -329,7 +329,7 @@ Enables an app account to access an application with the given bundle name. This checkAppAccountSyncEnable(name: string, callback: AsyncCallback<boolean>): void -Checks whether an app 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 API uses an asynchronous callback to return the result. **Required permissions**: ohos.permission.DISTRIBUTED_DATASYNC (available only to system applications) @@ -337,10 +337,10 @@ Checks whether an app account allows application data synchronization. This meth **Parameters** - | Name | Type | Mandatory | Description | - | -------- | ---------------------------- | ---- | ---------------------- | - | name | string | Yes | App account name. | - | callback | AsyncCallback<boolean> | Yes | Callback used to return whether the app account allows application data synchronization. | +| Name | Type | Mandatory | Description | +| -------- | ---------------------------- | ---- | ---------------------- | +| name | string | Yes | App account name. | +| callback | AsyncCallback<boolean> | Yes | Callback used to return whether the app account allows application data synchronization.| **Example** @@ -356,7 +356,7 @@ Checks whether an app account allows application data synchronization. This meth checkAppAccountSyncEnable(name: string): Promise<boolean> -Checks whether an app account allows application data synchronization. This method uses a promise to return the result. +Checks whether an app account allows application data synchronization. This API uses a promise to return the result. **Required permissions**: ohos.permission.DISTRIBUTED_DATASYNC (available only to system applications) @@ -364,15 +364,15 @@ Checks whether an app account allows application data synchronization. This meth **Parameters** - | Name | Type | Mandatory | Description | - | ---- | ------ | ---- | ------- | - | name | string | Yes | App account name. | +| Name | Type | Mandatory | Description | +| ---- | ------ | ---- | ------- | +| name | string | Yes | App account name.| **Return Value** - | Type | Description | - | :--------------------- | :-------------------- | - | Promise<boolean> | Promise used to return the result. | +| Type | Description | +| :--------------------- | :-------------------- | +| Promise<boolean> | Promise used to return the result.| **Example** @@ -387,20 +387,20 @@ Checks whether an app account allows application data synchronization. This meth ### setAccountCredential -setAccountCredential(name: string, credentialType: string, credential: string, callback: AsyncCallback<void>): void +setAccountCredential(name: string, credentialType: string, credential: string,callback: AsyncCallback<void>): void -Sets a credential for an app account. This method uses an asynchronous callback to return the result. +Sets a credential for an app account. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Account.AppAccount **Parameters** - | Name | Type | Mandatory | Description | - | -------------- | ------------------------- | ---- | -------------- | - | name | string | Yes | App account name. | - | credentialType | string | Yes | Type of the credential to set. | - | credential | string | Yes | Credential to set. | - | callback | AsyncCallback<void> | Yes | Callback invoked when a credential is set for the specified app account. | +| Name | Type | Mandatory | Description | +| -------------- | ------------------------- | ---- | -------------- | +| name | string | Yes | App account name. | +| credentialType | string | Yes | Type of the credential to set. | +| credential | string | Yes | Credential to set. | +| callback | AsyncCallback<void> | Yes | Callback invoked when a credential is set for the specified app account.| **Example** @@ -415,23 +415,23 @@ Sets a credential for an app account. This method uses an asynchronous callback setAccountCredential(name: string, credentialType: string, credential: string): Promise<void> -Sets a credential for an app account. This method uses a promise to return the result asynchronously. +Sets a credential for an app account. This API uses a promise to return the result asynchronously. **System capability**: SystemCapability.Account.AppAccount **Parameters** - | Name | Type | Mandatory | Description | - | -------------- | ------ | ---- | ---------- | - | name | string | Yes | App account name. | - | credentialType | string | Yes | Type of the credential to set. | - | credential | string | Yes | Credential to set. | +| Name | Type | Mandatory | Description | +| -------------- | ------ | ---- | ---------- | +| name | string | Yes | App account name. | +| credentialType | string | Yes | Type of the credential to set.| +| credential | string | Yes | Credential to set. | **Return Value** - | Type | Description | - | :------------------ | :-------------------- | - | Promise<void> | Promise used to return the result. | +| Type | Description | +| :------------------ | :-------------------- | +| Promise<void> | Promise used to return the result.| **Example** @@ -448,17 +448,17 @@ Sets a credential for an app account. This method uses a promise to return the r setAccountExtraInfo(name: string, extraInfo: string, callback: AsyncCallback<void>): void -Sets additional information for an app account. This method uses an asynchronous callback to return the result. +Sets additional information for an app account. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Account.AppAccount **Parameters** - | Name | Type | Mandatory | Description | - | --------- | ------------------------- | ---- | ---------------- | - | name | string | Yes | App account name. | - | extraInfo | string | Yes | Additional information to set. | - | callback | AsyncCallback<void> | Yes | Callback invoked when additional information is set for the specified app account. | +| Name | Type | Mandatory | Description | +| --------- | ------------------------- | ---- | ---------------- | +| name | string | Yes | App account name. | +| extraInfo | string | Yes | Additional information to set. | +| callback | AsyncCallback<void> | Yes | Callback invoked when additional information is set for the specified app account.| **Example** @@ -473,22 +473,22 @@ Sets additional information for an app account. This method uses an asynchronous setAccountExtraInfo(name: string, extraInfo: string): Promise<void> -Sets additional information for an app account. This method uses a promise to return the result asynchronously. +Sets additional information for an app account. This API uses a promise to return the result asynchronously. **System capability**: SystemCapability.Account.AppAccount **Parameters** - | Name | Type | Mandatory | Description | - | --------- | ------ | ---- | --------- | - | name | string | Yes | App account name. | - | extraInfo | string | Yes | Additional information to set. | +| Name | Type | Mandatory | Description | +| --------- | ------ | ---- | --------- | +| name | string | Yes | App account name. | +| extraInfo | string | Yes | Additional information to set.| **Return Value** - | Type | Description | - | :------------------ | :-------------------- | - | Promise<void> | Promise used to return the result. | +| Type | Description | +| :------------------ | :-------------------- | +| Promise<void> | Promise used to return the result.| **Example** @@ -505,7 +505,7 @@ Sets additional information for an app account. This method uses a promise to re setAppAccountSyncEnable(name: string, isEnable: boolean, callback: AsyncCallback<void>): void -Sets whether to enable application data synchronization for an app account. This method uses an asynchronous callback to return the result. +Sets whether to enable application data synchronization for an app account. This API uses an asynchronous callback to return the result. **Required permissions**: ohos.permission.DISTRIBUTED_DATASYNC (available only to system applications) @@ -513,11 +513,11 @@ Sets whether to enable application data synchronization for an app account. This **Parameters** - | Name | Type | Mandatory | Description | - | -------- | ------------------------- | ---- | ------------------------- | - | 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. | +| Name | Type | Mandatory | Description | +| -------- | ------------------------- | ---- | ------------------------- | +| 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** @@ -532,7 +532,7 @@ Sets whether to enable application data synchronization for an app account. This setAppAccountSyncEnable(name: string, isEnable: boolean): Promise<void> -Sets whether to enable application data synchronization for an app account. This method uses a promise to return the result asynchronously. +Sets whether to enable application data synchronization for an app account. This API uses a promise to return the result asynchronously. **Required permissions**: ohos.permission.DISTRIBUTED_DATASYNC (available only to system applications) @@ -540,16 +540,16 @@ Sets whether to enable application data synchronization for an app account. This **Parameters** - | Name | Type | Mandatory | Description | - | -------- | ------- | ---- | ----------- | - | name | string | Yes | App account name. | - | isEnable | boolean | Yes | Whether to enable app data synchronization. | +| Name | Type | Mandatory | Description | +| -------- | ------- | ---- | ----------- | +| name | string | Yes | App account name. | +| isEnable | boolean | Yes | Whether to enable app data synchronization.| **Return Value** - | Type | Description | - | :------------------ | :-------------------- | - | Promise<void> | Promise used to return the result. | +| Type | Description | +| :------------------ | :-------------------- | +| Promise<void> | Promise used to return the result.| **Example** @@ -566,18 +566,18 @@ Sets whether to enable application data synchronization for an app account. This setAssociatedData(name: string, key: string, value: string, callback: AsyncCallback<void>): void -Sets data to be associated with an app account. This method uses an asynchronous callback to return the result. +Sets data to be associated with an app account. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Account.AppAccount **Parameters** - | Name | Type | Mandatory | Description | - | -------- | ------------------------- | ---- | ----------------- | - | name | string | Yes | App account name. | - | key | string | Yes | Key of the data to set. The private key can be customized. | - | value | string | Yes | Value of the data to be set. | - | callback | AsyncCallback<void> | Yes | Callback invoked when the data associated with the specified app account is set. | +| Name | Type | Mandatory | Description | +| -------- | ------------------------- | ---- | ----------------- | +| name | string | Yes | App account name. | +| key | string | Yes | Key of the data to set. The private key can be customized.| +| value | string | Yes | Value of the data to be set. | +| callback | AsyncCallback<void> | Yes | Callback invoked when the data associated with the specified app account is set.| **Example** @@ -591,23 +591,23 @@ Sets data to be associated with an app account. This method uses an asynchronous setAssociatedData(name: string, key: string, value: string): Promise<void> -Sets data to be associated with an app account. This method uses a promise to return the result asynchronously. +Sets data to be associated with an app account. This API uses a promise to return the result asynchronously. **System capability**: SystemCapability.Account.AppAccount **Parameters** - | Name | Type | Mandatory | Description | - | ----- | ------ | ---- | ----------------- | - | name | string | Yes | App account name. | - | key | string | Yes | Key of the data to set. The private key can be customized. | - | value | string | Yes | Value of the data to be set. | +| Name | Type | Mandatory | Description | +| ----- | ------ | ---- | ----------------- | +| name | string | Yes | App account name. | +| key | string | Yes | Key of the data to set. The private key can be customized.| +| value | string | Yes | Value of the data to be set. | **Return Value** - | Type | Description | - | :------------------ | :-------------------- | - | Promise<void> | Promise used to return the result. | +| Type | Description | +| :------------------ | :-------------------- | +| Promise<void> | Promise used to return the result.| **Example** @@ -624,17 +624,17 @@ Sets data to be associated with an app account. This method uses a promise to re getAccountCredential(name: string, credentialType: string, callback: AsyncCallback<string>): void -Obtains the credential of an app account. This method uses an asynchronous callback to return the result. +Obtains the credential of an app account. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Account.AppAccount **Parameters** - | Name | Type | Mandatory | Description | - | -------------- | --------------------------- | ---- | -------------- | - | name | string | Yes | App account name. | - | credentialType | string | Yes | Type of the credential to obtain. | - | callback | AsyncCallback<string> | Yes | Callback invoked to return the credential of the specified app account. | +| Name | Type | Mandatory | Description | +| -------------- | --------------------------- | ---- | -------------- | +| name | string | Yes | App account name. | +| credentialType | string | Yes | Type of the credential to obtain. | +| callback | AsyncCallback<string> | Yes | Callback invoked to return the credential of the specified app account.| **Example** @@ -650,22 +650,22 @@ Obtains the credential of an app account. This method uses an asynchronous callb getAccountCredential(name: string, credentialType: string): Promise<string> -Obtains the credential of an app account. This method uses a promise to return the result asynchronously. +Obtains the credential of an app account. This API uses a promise to return the result asynchronously. **System capability**: SystemCapability.Account.AppAccount **Parameters** - | Name | Type | Mandatory | Description | - | -------------- | ------ | ---- | ---------- | - | name | string | Yes | App account name. | - | credentialType | string | Yes | Type of the credential to obtain. | +| Name | Type | Mandatory | Description | +| -------------- | ------ | ---- | ---------- | +| name | string | Yes | App account name. | +| credentialType | string | Yes | Type of the credential to obtain.| **Return Value** - | Type | Description | - | :-------------------- | :-------------------- | - | Promise<string> | Promise used to return the result. | +| Type | Description | +| :-------------------- | :-------------------- | +| Promise<string> | Promise used to return the result.| **Example** @@ -682,16 +682,16 @@ Obtains the credential of an app account. This method uses a promise to return t getAccountExtraInfo(name: string, callback: AsyncCallback<string>): void -Obtains additional information of an app account. This method uses an asynchronous callback to return the result. +Obtains additional information of an app account. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Account.AppAccount **Parameters** - | Name | Type | Mandatory | Description | - | -------- | --------------------------- | ---- | ---------------- | - | name | string | Yes | App account name. | - | callback | AsyncCallback<string> | Yes | Callback invoked to return the additional information of the specified app account. | +| Name | Type | Mandatory | Description | +| -------- | --------------------------- | ---- | ---------------- | +| name | string | Yes | App account name. | +| callback | AsyncCallback<string> | Yes | Callback invoked to return the additional information of the specified app account.| **Example** @@ -707,21 +707,21 @@ Obtains additional information of an app account. This method uses an asynchrono getAccountExtraInfo(name: string): Promise<string> -Obtains additional information of an app account. This method uses a promise to return the result asynchronously. +Obtains additional information of an app account. This API uses a promise to return the result asynchronously. **System capability**: SystemCapability.Account.AppAccount **Parameters** - | Name | Type | Mandatory | Description | - | ---- | ------ | ---- | ------- | - | name | string | Yes | App account name. | +| Name | Type | Mandatory | Description | +| ---- | ------ | ---- | ------- | +| name | string | Yes | App account name.| **Return Value** - | Type | Description | - | :-------------------- | :-------------------- | - | Promise<string> | Promise used to return the result. | +| Type | Description | +| :-------------------- | :-------------------- | +| Promise<string> | Promise used to return the result.| **Example** @@ -738,17 +738,17 @@ Obtains additional information of an app account. This method uses a promise to getAssociatedData(name: string, key: string, callback: AsyncCallback<string>): void -Obtains data associated with an app account. This method uses an asynchronous callback to return the result. +Obtains data associated with an app account. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Account.AppAccount **Parameters** - | Name | Type | Mandatory | Description | - | -------- | --------------------------- | ---- | ----------------- | - | name | string | Yes | App account name. | - | key | string | Yes | Key of the data to obtain. | - | callback | AsyncCallback<string> | Yes | Callback invoked to return the data associated with the specified app account. | +| Name | Type | Mandatory | Description | +| -------- | --------------------------- | ---- | ----------------- | +| name | string | Yes | App account name. | +| key | string | Yes | Key of the data to obtain. | +| callback | AsyncCallback<string> | Yes | Callback invoked to return the data associated with the specified app account.| **Example** @@ -764,22 +764,22 @@ Obtains data associated with an app account. This method uses an asynchronous ca getAssociatedData(name: string, key: string): Promise<string> -Obtains data associated with an app account. This method uses a promise to return the result asynchronously. +Obtains data associated with an app account. This API uses a promise to return the result asynchronously. **System capability**: SystemCapability.Account.AppAccount **Parameters** - | Name | Type | Mandatory | Description | - | ---- | ------ | ---- | ----------- | - | name | string | Yes | App account name. | - | key | string | Yes | Key of the data to obtain. | +| Name | Type | Mandatory | Description | +| ---- | ------ | ---- | ----------- | +| name | string | Yes | App account name. | +| key | string | Yes | Key of the data to obtain.| **Return Value** - | Type | Description | - | :-------------------- | :-------------------- | - | Promise<string> | Promise used to return the result. | +| Type | Description | +| :-------------------- | :-------------------- | +| Promise<string> | Promise used to return the result.| **Example** @@ -796,7 +796,7 @@ Obtains data associated with an app account. This method uses a promise to retur getAllAccessibleAccounts(callback: AsyncCallback<Array<AppAccountInfo>>): void -Obtains information about all accessible app accounts. This method uses an asynchronous callback to return the result. +Obtains information about all accessible app accounts. This API uses an asynchronous callback to return the result. **Required permissions**: ohos.permission.GET_ALL_APP_ACCOUNTS (available only to system applications) @@ -804,9 +804,9 @@ Obtains information about all accessible app accounts. This method uses an async **Parameters** - | Name | Type | Mandatory | Description | - | -------- | ---------------------------------------- | ---- | -------- | - | callback | AsyncCallback<Array<AppAccountInfo>> | Yes | Callback invoked to return information about all accessible app accounts. | +| Name | Type | Mandatory | Description | +| -------- | ---------------------------------------- | ---- | -------- | +| callback | AsyncCallback<Array<AppAccountInfo>> | Yes | Callback invoked to return information about all accessible app accounts.| **Example** @@ -822,7 +822,7 @@ Obtains information about all accessible app accounts. This method uses an async getAllAccessibleAccounts(): Promise<Array<AppAccountInfo>> -Obtains information about all accessible app accounts. This method uses an asynchronous callback to return the result. +Obtains information about all accessible app accounts. This API uses a promise to return the result. **Required permissions**: ohos.permission.GET_ALL_APP_ACCOUNTS (available only to system applications) @@ -830,9 +830,9 @@ Obtains information about all accessible app accounts. This method uses an async **Parameters** - | Type | Description | - | ---------------------------------------- | --------------------- | - | Promise<Array<AppAccountInfo>> | Promise used to return the result. | +| Type | Description | +| ---------------------------------------- | --------------------- | +| Promise<Array<AppAccountInfo>> | Promise used to return the result.| **Example** @@ -849,7 +849,7 @@ Obtains information about all accessible app accounts. This method uses an async getAllAccounts(owner: string, callback: AsyncCallback<Array<AppAccountInfo>>): void -Obtains information about all app accounts of the specified app. This method uses an asynchronous callback to return the result. +Obtains information about all app accounts of the specified app. This API uses an asynchronous callback to return the result. **Required permissions**: ohos.permission.GET_ALL_APP_ACCOUNTS (available only to system applications) @@ -857,10 +857,10 @@ Obtains information about all app accounts of the specified app. This method use **Parameters** - | Name | Type | Mandatory | Description | - | -------- | ---------------------------------------- | ---- | -------- | - | owner | string | Yes | Bundle name of the app. | - | callback | AsyncCallback<Array<AppAccountInfo>> | Yes | Callback invoked to return information about all accessible app accounts. | +| Name | Type | Mandatory | Description | +| -------- | ---------------------------------------- | ---- | -------- | +| owner | string | Yes | Bundle name of the app. | +| callback | AsyncCallback<Array<AppAccountInfo>> | Yes | Callback invoked to return information about all accessible app accounts.| **Example** @@ -877,7 +877,7 @@ Obtains information about all app accounts of the specified app. This method use getAllAccounts(owner: string): Promise<Array<AppAccountInfo>> -Obtains information about all app accounts of the specified app. This method uses an asynchronous callback to return the result. +Obtains information about all app accounts of the specified app. This API uses a promise to return the result. **Required permissions**: ohos.permission.GET_ALL_APP_ACCOUNTS (available only to system applications) @@ -885,15 +885,15 @@ Obtains information about all app accounts of the specified app. This method use **Parameters** - | Name | Type | Mandatory | Description | - | ----- | ------ | ---- | ----- | - | owner | string | Yes | Bundle name of the app. | +| Name | Type | Mandatory | Description | +| ----- | ------ | ---- | ----- | +| owner | string | Yes | Bundle name of the app.| **Parameters** - | Type | Description | - | ---------------------------------------- | --------------------- | - | Promise<Array<AppAccountInfo>> | Promise used to return the result. | +| Type | Description | +| ---------------------------------------- | --------------------- | +| Promise<Array<AppAccountInfo>> | Promise used to return the result.| **Example** @@ -911,17 +911,17 @@ Obtains information about all app accounts of the specified app. This method use on(type: 'change', owners: Array<string>, callback: Callback<Array<AppAccountInfo>>): void -Subscribes to the account change event of the specified account owners. This method uses an asynchronous callback to return the result. +Subscribes to the account change event of the specified account owners. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Account.AppAccount **Parameters** - | Name | Type | Mandatory | Description | - | -------- | ---------------------------------------- | ---- | ------------------------------ | - | 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. | +| Name | Type | Mandatory | Description | +| -------- | ---------------------------------------- | ---- | ------------------------------ | +| 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. | **Example** @@ -942,16 +942,16 @@ Subscribes to the account change event of the specified account owners. This met off(type: 'change', callback?: Callback>): void -Unsubscribes from the account change event. This method uses an asynchronous callback to return the result. +Unsubscribes from the account change event. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Account.AppAccount **Parameters** - | Name | Type | Mandatory | Description | - | -------- | -------------------------------- | ---- | ------------ | - | type | 'change' | Yes | Account change event to unsubscribe from. | - | callback | Callback> | No | Callback used to report the account change. | +| Name | Type | Mandatory | Description | +| -------- | -------------------------------- | ---- | ------------ | +| type | 'change' | Yes | Account change event to unsubscribe from. | +| callback | Callback> | No | Callback used to report the account change.| **Example** @@ -975,19 +975,19 @@ Unsubscribes from the account change event. This method uses an asynchronous cal authenticate(name: string, owner: string, authType: string, options: {[key: string]: any}, callback: AuthenticatorCallback): void -Authenticates an app account to obtain the Open Authorization (OAuth) access token. This method uses an asynchronous callback to return the result. +Authenticates an app account to obtain the Open Authorization (OAuth) access token. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Account.AppAccount **Parameters** - | Name | Type | Mandatory | Description | - | -------- | --------------------- | ---- | --------------- | - | name | string | Yes | Name of the app account to authenticate. | - | owner | string | Yes | Bundle name of the app. | - | authType | string | Yes | Authentication type. | - | options | {[key: string]: any} | Yes | Options for the authentication. | - | callback | AuthenticatorCallback | Yes | Authenticator callback invoked to return the authentication result. | +| Name | Type | Mandatory | Description | +| -------- | --------------------- | ---- | --------------- | +| name | string | Yes | Name of the app account to authenticate. | +| owner | string | Yes | Bundle name of the app.| +| authType | string | Yes | Authentication type. | +| options | {[key: string]: any} | Yes | Options for the authentication. | +| callback | AuthenticatorCallback | Yes | Authenticator callback invoked to return the authentication result.| **Example** @@ -1017,18 +1017,18 @@ Authenticates an app account to obtain the Open Authorization (OAuth) access tok getOAuthToken(name: string, owner: string, authType: string, callback: AsyncCallback<string>): void -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 access token of an app account based on the specified authentication type. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Account.AppAccount **Parameters** - | Name | Type | Mandatory | Description | - | -------- | --------------------------- | ---- | ----------- | - | name | string | Yes | App account name. | - | owner | string | Yes | Bundle name of the app. | - | authType | string | Yes | Authentication type. | - | callback | AsyncCallback<string> | Yes | Callback invoked to return the result. | +| Name | Type | Mandatory | Description | +| -------- | --------------------------- | ---- | ----------- | +| name | string | Yes | App account name. | +| owner | string | Yes | Bundle name of the app.| +| authType | string | Yes | Authentication type. | +| callback | AsyncCallback<string> | Yes | Callback invoked to return the result. | **Example** @@ -1044,23 +1044,23 @@ Obtains the OAuth access token of an app account based on the specified authenti getOAuthToken(name: string, owner: string, authType: string): Promise<string> -Obtains the OAuth access token of an app account based on the specified authentication type. This method uses a promise to return the result. +Obtains the OAuth access token of an app account based on the specified authentication type. This API uses a promise to return the result. **System capability**: SystemCapability.Account.AppAccount **Parameters** - | Name | Type | Mandatory | Description | - | -------- | ------ | ---- | ----------- | - | name | string | Yes | App account name. | - | owner | string | Yes | Bundle name of the app. | - | authType | string | Yes | Authentication type. | +| Name | Type | Mandatory | Description | +| -------- | ------ | ---- | ----------- | +| name | string | Yes | App account name. | +| owner | string | Yes | Bundle name of the app.| +| authType | string | Yes | Authentication type. | **Parameters** - | Type | Description | - | --------------------- | --------------------- | - | Promise<string> | Promise used to return the result. | +| Type | Description | +| --------------------- | --------------------- | +| Promise<string> | Promise used to return the result.| **Example** @@ -1077,18 +1077,18 @@ Obtains the OAuth access token of an app account based on the specified authenti setOAuthToken(name: string, authType: string, token: string, callback: AsyncCallback<void>): void -Sets an OAuth access token for an app account. This method uses an asynchronous callback to return the result. +Sets an OAuth access token for an app account. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Account.AppAccount **Parameters** - | Name | Type | Mandatory | Description | - | -------- | ------------------------- | ---- | -------- | - | name | string | Yes | App account name. | - | authType | string | Yes | Authentication type. | - | token | string | Yes | OAuth access token to set. | - | callback | AsyncCallback<void> | Yes | Callback invoked to return the result. | +| Name | Type | Mandatory | Description | +| -------- | ------------------------- | ---- | -------- | +| name | string | Yes | App account name.| +| authType | string | Yes | Authentication type. | +| token | string | Yes | OAuth access token to set.| +| callback | AsyncCallback<void> | Yes | Callback invoked to return the result.| **Example** @@ -1103,23 +1103,23 @@ Sets an OAuth access token for an app account. This method uses an asynchronous setOAuthToken(name: string, authType: string, token: string): Promise<void> -Sets an OAuth access token for an app account. This method uses a promise to return the result. +Sets an OAuth access token for an app account. This API uses a promise to return the result. **System capability**: SystemCapability.Account.AppAccount **Parameters** - | Name | Type | Mandatory | Description | - | -------- | ------ | ---- | -------- | - | name | string | Yes | App account name. | - | authType | string | Yes | Authentication type. | - | token | string | Yes | OAuth access token to set. | +| Name | Type | Mandatory | Description | +| -------- | ------ | ---- | -------- | +| name | string | Yes | App account name.| +| authType | string | Yes | Authentication type. | +| token | string | Yes | OAuth access token to set.| **Parameters** - | Type | Description | - | ------------------- | --------------------- | - | Promise<void> | Promise used to return the result. | +| Type | Description | +| ------------------- | --------------------- | +| Promise<void> | Promise used to return the result.| **Example** @@ -1136,19 +1136,19 @@ Sets an OAuth access token for an app account. This method uses a promise to ret deleteOAuthToken(name: string, owner: string, authType: string, token: string, callback: AsyncCallback<void>): void -Deletes the specified OAuth access token for an app account. This method uses an asynchronous callback to return the result. +Deletes the specified OAuth access token for an app account. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Account.AppAccount **Parameters** - | Name | Type | Mandatory | Description | - | -------- | ------------------------- | ---- | ------------ | - | name | string | Yes | App account name. | - | owner | string | Yes | Bundle name of the app. | - | authType | string | Yes | Authentication type. | - | token | string | Yes | OAuth access token to delete. | - | callback | AsyncCallback<void> | Yes | Callback invoked to return the result. | +| Name | Type | Mandatory | Description | +| -------- | ------------------------- | ---- | ------------ | +| name | string | Yes | App account name. | +| owner | string | Yes | Bundle name of the app. | +| authType | string | Yes | Authentication type. | +| token | string | Yes | OAuth access token to delete.| +| callback | AsyncCallback<void> | Yes | Callback invoked to return the result. | **Example** @@ -1163,24 +1163,24 @@ Deletes the specified OAuth access token for an app account. This method uses an deleteOAuthToken(name: string, owner: string, authType: string, token: string): Promise<void> -Deletes the specified OAuth access token for an app account. This method uses a promise to return the result. +Deletes the specified OAuth access token for an app account. This API uses a promise to return the result. **System capability**: SystemCapability.Account.AppAccount **Parameters** - | Name | Type | Mandatory | Description | - | -------- | ------ | ---- | ------------ | - | name | string | Yes | App account name. | - | owner | string | Yes | Bundle name of the app. | - | authType | string | Yes | Authentication type. | - | token | string | Yes | OAuth access token to delete. | +| Name | Type | Mandatory | Description | +| -------- | ------ | ---- | ------------ | +| name | string | Yes | App account name. | +| owner | string | Yes | Bundle name of the app. | +| authType | string | Yes | Authentication type. | +| token | string | Yes | OAuth access token to delete.| **Parameters** - | Type | Description | - | ------------------- | --------------------- | - | Promise<void> | Promise used to return the result. | +| Type | Description | +| ------------------- | --------------------- | +| Promise<void> | Promise used to return the result.| **Example** @@ -1197,19 +1197,19 @@ Deletes the specified OAuth access token for an app account. This method uses a setOAuthTokenVisibility(name: string, authType: string, bundleName: string, isVisible: boolean, callback: AsyncCallback<void>): void -Sets the visibility of an OAuth access token to the specified app. This method uses an asynchronous callback to return the result. +Sets the visibility of an OAuth access token to the specified app. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Account.AppAccount **Parameters** - | Name | Type | Mandatory | Description | - | ---------- | ------------------------- | ---- | ------------ | - | name | string | Yes | App account name. | - | authType | string | Yes | Authentication type. | - | bundleName | string | Yes | Bundle name of the app. | - | isVisible | boolean | Yes | Whether the OAuth access token is visible to the app. | - | callback | AsyncCallback<void> | Yes | Callback invoked to return the result. | +| Name | Type | Mandatory | Description | +| ---------- | ------------------------- | ---- | ------------ | +| name | string | Yes | App account name. | +| authType | string | Yes | Authentication type. | +| bundleName | string | Yes | Bundle name of the app.| +| isVisible | boolean | Yes | Whether the OAuth access token is visible to the app. | +| callback | AsyncCallback<void> | Yes | Callback invoked to return the result. | **Example** @@ -1224,24 +1224,24 @@ Sets the visibility of an OAuth access token to the specified app. This method u setOAuthTokenVisibility(name: string, authType: string, bundleName: string, isVisible: boolean): Promise<void> -Sets the visibility of an OAuth access token to the specified app. This method uses a promise to return the result. +Sets the visibility of an OAuth access token to the specified app. This API uses a promise to return the result. **System capability**: SystemCapability.Account.AppAccount **Parameters** - | Name | Type | Mandatory | Description | - | ---------- | ------- | ---- | ------------ | - | name | string | Yes | App account name. | - | authType | string | Yes | Authentication type. | - | bundleName | string | Yes | Bundle name of the app. | - | isVisible | boolean | Yes | Whether the OAuth access token is visible to the app. | +| Name | Type | Mandatory | Description | +| ---------- | ------- | ---- | ------------ | +| name | string | Yes | App account name. | +| authType | string | Yes | Authentication type. | +| bundleName | string | Yes | Bundle name of the app.| +| isVisible | boolean | Yes | Whether the OAuth access token is visible to the app. | **Parameters** - | Type | Description | - | ------------------- | --------------------- | - | Promise<void> | Promise used to return the result. | +| Type | Description | +| ------------------- | --------------------- | +| Promise<void> | Promise used to return the result.| **Example** @@ -1258,18 +1258,18 @@ Sets the visibility of an OAuth access token to the specified app. This method u checkOAuthTokenVisibility(name: string, authType: string, bundleName: string, callback: AsyncCallback<boolean>): void -Checks whether an OAuth token is visible to the specified app. This method uses an asynchronous callback to return the result. +Checks whether an OAuth token is visible to the specified app. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Account.AppAccount **Parameters** - | Name | Type | Mandatory | Description | - | ---------- | ---------------------------- | ---- | ------------- | - | name | string | Yes | App account name. | - | authType | string | Yes | Authentication type. | - | bundleName | string | Yes | Bundle name of the app. | - | callback | AsyncCallback<boolean> | Yes | Callback invoked to return the result. | +| Name | Type | Mandatory | Description | +| ---------- | ---------------------------- | ---- | ------------- | +| name | string | Yes | App account name. | +| authType | string | Yes | Authentication type. | +| bundleName | string | Yes | Bundle name of the app.| +| callback | AsyncCallback<boolean> | Yes | Callback invoked to return the result. | **Example** @@ -1285,23 +1285,23 @@ Checks whether an OAuth token is visible to the specified app. This method uses checkOAuthTokenVisibility(name: string, authType: string, bundleName: string): Promise<boolean> -Checks whether an OAuth token is visible to the specified app. This method uses a promise to return the result. +Checks whether an OAuth token is visible to the specified app. This API uses a promise to return the result. **System capability**: SystemCapability.Account.AppAccount **Parameters** - | Name | Type | Mandatory | Description | - | ---------- | ------ | ---- | ------------- | - | name | string | Yes | App account name. | - | authType | string | Yes | Authentication type. | - | bundleName | string | Yes | Bundle name of the app. | +| Name | Type | Mandatory | Description | +| ---------- | ------ | ---- | ------------- | +| name | string | Yes | App account name. | +| authType | string | Yes | Authentication type. | +| bundleName | string | Yes | Bundle name of the app.| **Parameters** - | Type | Description | - | ---------------------- | --------------------- | - | Promise<boolean> | Promise used to return the result. | +| Type | Description | +| ---------------------- | --------------------- | +| Promise<boolean> | Promise used to return the result.| **Example** @@ -1318,17 +1318,17 @@ Checks whether an OAuth token is visible to the specified app. This method uses getAllOAuthTokens(name: string, owner: string, callback: AsyncCallback<Array<OAuthTokenInfo>>): void -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 information about all OAuth access tokens of an app account visible to the specified app. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Account.AppAccount **Parameters** - | Name | Type | Mandatory | Description | - | -------- | ---------------------------------------- | ---- | ----------- | - | name | string | Yes | App account name. | - | owner | string | Yes | Bundle name of the app. | - | callback | AsyncCallback<Array<OAuthTokenInfo>> | Yes | Callback invoked to return the result. | +| Name | Type | Mandatory | Description | +| -------- | ---------------------------------------- | ---- | ----------- | +| name | string | Yes | App account name. | +| owner | string | Yes | Bundle name of the app.| +| callback | AsyncCallback<Array<OAuthTokenInfo>> | Yes | Callback invoked to return the result. | **Example** @@ -1344,22 +1344,22 @@ Obtains information about all OAuth access tokens of an app account visible to t getAllOAuthTokens(name: string, owner: string): Promise<Array<OAuthTokenInfo>> -Obtains information about all OAuth access tokens of an app account visible to the specified app. This method uses a promise to return the result. +Obtains information about all OAuth access tokens of an app account visible to the specified app. This API uses a promise to return the result. **System capability**: SystemCapability.Account.AppAccount **Parameters** - | Name | Type | Mandatory | Description | - | ----- | ------ | ---- | ----------- | - | name | string | Yes | App account name. | - | owner | string | Yes | Bundle name of the app. | +| Name | Type | Mandatory | Description | +| ----- | ------ | ---- | ----------- | +| name | string | Yes | App account name. | +| owner | string | Yes | Bundle name of the app.| **Parameters** - | Type | Description | - | ---------------------------------------- | --------------------- | - | Promise<Array<OAuthTokenInfo>> | Promise used to return the result. | +| Type | Description | +| ---------------------------------------- | --------------------- | +| Promise<Array<OAuthTokenInfo>> | Promise used to return the result.| **Example** @@ -1376,17 +1376,17 @@ Obtains information about all OAuth access tokens of an app account visible to t getOAuthList(name: string, authType: string, callback: AsyncCallback<Array<string>>): void -Obtains the authorization list of OAuth access tokens of an app account. This method uses an asynchronous callback to return the result. +Obtains the authorization list of OAuth access tokens of an app account. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Account.AppAccount **Parameters** - | Name | Type | Mandatory | Description | - | -------- | ---------------------------------------- | ---- | ----------- | - | name | string | Yes | App account name. | - | owner | string | Yes | Bundle name of the app. | - | callback | AsyncCallback<Array<string>> | Yes | Callback invoked to return the result. | +| Name | Type | Mandatory | Description | +| -------- | ---------------------------------------- | ---- | ----------- | +| name | string | Yes | App account name. | +| owner | string | Yes | Bundle name of the app.| +| callback | AsyncCallback<Array<string>> | Yes | Callback invoked to return the result. | **Example** @@ -1402,22 +1402,22 @@ Obtains the authorization list of OAuth access tokens of an app account. This me getOAuthList(name: string, authType: string): Promise<Array<string>> -Obtains the authorization list of OAuth access tokens of an app account. This method uses a promise to return the result. +Obtains the authorization list of OAuth access tokens of an app account. This API uses a promise to return the result. **System capability**: SystemCapability.Account.AppAccount **Parameters** - | Name | Type | Mandatory | Description | - | ----- | ------ | ---- | ----------- | - | name | string | Yes | App account name. | - | owner | string | Yes | Bundle name of the app. | +| Name | Type | Mandatory | Description | +| ----- | ------ | ---- | ----------- | +| name | string | Yes | App account name. | +| owner | string | Yes | Bundle name of the app.| **Parameters** - | Type | Description | - | ---------------------------------- | --------------------- | - | Promise<Array<string>> | Promise used to return the result. | +| Type | Description | +| ---------------------------------- | --------------------- | +| Promise<Array<string>> | Promise used to return the result.| **Example** @@ -1434,16 +1434,16 @@ Obtains the authorization list of OAuth access tokens of an app account. This me getAuthenticatorCallback(sessionId: string, callback: AsyncCallback<AuthenticatorCallback>): void -Obtains the authenticator callback for a session. This method uses an asynchronous callback to return the result. +Obtains the authenticator callback for a session. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Account.AppAccount **Parameters** - | Name | Type | Mandatory | Description | - | --------- | ---------------------------------------- | ---- | -------- | - | sessionId | string | Yes | ID of the session to authenticate. | - | callback | AsyncCallback<AuthenticatorCallback> | Yes | Callback invoked to return the result. | +| Name | Type | Mandatory | Description | +| --------- | ---------------------------------------- | ---- | -------- | +| sessionId | string | Yes | ID of the session to authenticate.| +| callback | AsyncCallback<AuthenticatorCallback> | Yes | Callback invoked to return the result.| **Example** @@ -1469,21 +1469,21 @@ Obtains the authenticator callback for a session. This method uses an asynchrono getAuthenticatorCallback(sessionId: string): Promise<AuthenticatorCallback> -Obtains the authenticator callback for a session. This method uses a promise to return the result. +Obtains the authenticator callback for a session. This API uses a promise to return the result. **System capability**: SystemCapability.Account.AppAccount **Parameters** - | Name | Type | Mandatory | Description | - | --------- | ------ | ---- | -------- | - | sessionId | string | Yes | ID of the session to authenticate. | +| Name | Type | Mandatory | Description | +| --------- | ------ | ---- | -------- | +| sessionId | string | Yes | ID of the session to authenticate.| **Parameters** - | Type | Description | - | ------------------------------------ | --------------------- | - | Promise<AuthenticatorCallback> | Promise used to return the result. | +| Type | Description | +| ------------------------------------ | --------------------- | +| Promise<AuthenticatorCallback> | Promise used to return the result.| **Example** @@ -1509,16 +1509,16 @@ Obtains the authenticator callback for a session. This method uses a promise to getAuthenticatorInfo(owner: string, callback: AsyncCallback<AuthenticatorInfo>): void -Obtains authenticator information of an app account. This method uses an asynchronous callback to return the result. +Obtains authenticator information of an app account. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Account.AppAccount **Parameters** - | Name | Type | Mandatory | Description | - | -------- | -------------------------------------- | ---- | ----------- | - | owner | string | Yes | Bundle name of the app. | - | callback | AsyncCallback<AuthenticatorInfo> | Yes | Callback invoked to return the result. | +| Name | Type | Mandatory | Description | +| -------- | -------------------------------------- | ---- | ----------- | +| owner | string | Yes | Bundle name of the app.| +| callback | AsyncCallback<AuthenticatorInfo> | Yes | Callback invoked to return the result. | **Example** @@ -1534,21 +1534,21 @@ Obtains authenticator information of an app account. This method uses an asynchr getAuthenticatorInfo(owner: string): Promise<AuthenticatorInfo> -Obtains authenticator information of an app account. This method uses a promise to return the result. +Obtains authenticator information of an app account. This API uses a promise to return the result. **System capability**: SystemCapability.Account.AppAccount **Parameters** - | Name | Type | Mandatory | Description | - | ----- | ------ | ---- | ----------- | - | owner | string | Yes | Bundle name of the app. | +| Name | Type | Mandatory | Description | +| ----- | ------ | ---- | ----------- | +| owner | string | Yes | Bundle name of the app.| **Parameters** - | Type | Description | - | -------------------------------- | --------------------- | - | Promise<AuthenticatorInfo> | Promise used to return the result. | +| Type | Description | +| -------------------------------- | --------------------- | +| Promise<AuthenticatorInfo> | Promise used to return the result.| **Example** @@ -1567,10 +1567,10 @@ Defines app account information. **System capability**: SystemCapability.Account.AppAccount - | Name | Type | Mandatory | Description | - | ----- | ------ | ---- | ----------- | - | owner | string | Yes | Bundle name of the app. | - | name | string | Yes | App account name. | +| Name | Type | Mandatory | Description | +| ----- | ------ | ---- | ----------- | +| owner | string | Yes | Bundle name of the app.| +| name | string | Yes | App account name. | ## OAuthTokenInfo8+ @@ -1578,10 +1578,10 @@ Defines OAuth access token information. **System capability**: SystemCapability.Account.AppAccount - | Name | Type | Mandatory | Description | - | -------- | ------ | ---- | -------- | - | authType | string | Yes | Authentication type. | - | token | string | Yes | Value of the access token. | +| Name | Type | Mandatory | Description | +| -------- | ------ | ---- | -------- | +| authType | string | Yes | Authentication type.| +| token | string | Yes | Value of the access token. | ## AuthenticatorInfo8+ @@ -1589,11 +1589,11 @@ Defines OAuth authenticator information. **System capability**: SystemCapability.Account.AppAccount - | Name | Type | Mandatory | Description | - | ------- | ------ | ---- | ---------- | - | owner | string | Yes | Bundle name of the authenticator owner. | - | iconId | string | Yes | ID of the authenticator icon. | - | labelId | string | Yes | ID of the authenticator label. | +| Name | Type | Mandatory | Description | +| ------- | ------ | ---- | ---------- | +| owner | string | Yes | Bundle name of the authenticator owner.| +| iconId | string | Yes | ID of the authenticator icon. | +| labelId | string | Yes | ID of the authenticator label. | ## Constants8+ @@ -1601,19 +1601,19 @@ Enumerates the constants. **System capability**: SystemCapability.Account.AppAccount - | Name | Default Value | Description | - | ----------------------------- | ---------------------- | ------------- | - | ACTION_ADD_ACCOUNT_IMPLICITLY | "addAccountImplicitly" | Operation for implicitly adding an account. | - | ACTION_AUTHENTICATE | "authenticate" | Authentication operation. | - | KEY_NAME | "name" | App account name. | - | KEY_OWNER | "owner" | App account owner. | - | KEY_TOKEN | "token" | OAuth access token. | - | KEY_ACTION | "action" | Action. | - | KEY_AUTH_TYPE | "authType" | Authentication type. | - | KEY_SESSION_ID | "sessionId" | Session ID. | - | KEY_CALLER_PID | "callerPid" | Caller process ID (PID). | - | KEY_CALLER_UID | "callerUid" | Caller user ID (UID). | - | KEY_CALLER_BUNDLE_NAME | "callerBundleName" | Caller bundle name. | +| Name | Default Value | Description | +| ----------------------------- | ---------------------- | ------------- | +| ACTION_ADD_ACCOUNT_IMPLICITLY | "addAccountImplicitly" | Operation for implicitly adding an account. | +| ACTION_AUTHENTICATE | "authenticate" | Authentication operation. | +| KEY_NAME | "name" | App account name. | +| KEY_OWNER | "owner" | App account owner.| +| KEY_TOKEN | "token" | OAuth access token. | +| KEY_ACTION | "action" | Action. | +| KEY_AUTH_TYPE | "authType" | Authentication type. | +| KEY_SESSION_ID | "sessionId" | Session ID. | +| KEY_CALLER_PID | "callerPid" | Caller process ID (PID). | +| KEY_CALLER_UID | "callerUid" | Caller user ID (UID). | +| KEY_CALLER_BUNDLE_NAME | "callerBundleName" | Caller bundle name. | ## ResultCode8+ @@ -1621,27 +1621,27 @@ Enumerates the result codes. **System capability**: SystemCapability.Account.AppAccount - | Name | Default Value | Description | - | ----------------------------------- | ----- | ------------ | - | SUCCESS | 0 | The operation is successful. | - | ERROR_ACCOUNT_NOT_EXIST | 10001 | The app account does not exist. | - | ERROR_APP_ACCOUNT_SERVICE_EXCEPTION | 10002 | The app account service is abnormal. | - | ERROR_INVALID_PASSWORD | 10003 | The password is invalid. | - | ERROR_INVALID_REQUEST | 10004 | The request is invalid. | - | ERROR_INVALID_RESPONSE | 10005 | The response is invalid. | - | ERROR_NETWORK_EXCEPTION | 10006 | The network is abnormal. | - | ERROR_OAUTH_AUTHENTICATOR_NOT_EXIST | 10007 | The authenticator does not exist. | - | ERROR_OAUTH_CANCELED | 10008 | The authentication is canceled. | - | ERROR_OAUTH_LIST_TOO_LARGE | 10009 | The size of the OAuth list exceeds the limit. | - | ERROR_OAUTH_SERVICE_BUSY | 10010 | The OAuth service is busy. | - | ERROR_OAUTH_SERVICE_EXCEPTION | 10011 | The OAuth service is abnormal. | - | ERROR_OAUTH_SESSION_NOT_EXIST | 10012 | The session to be authenticated does not exist. | - | ERROR_OAUTH_TIMEOUT | 10013 | The authentication timed out. | - | ERROR_OAUTH_TOKEN_NOT_EXIST | 10014 | The OAuth access token does not exist. | - | ERROR_OAUTH_TOKEN_TOO_MANY | 10015 | The number of OAuth access tokens reaches the limit. | - | ERROR_OAUTH_UNSUPPORT_ACTION | 10016 | The authentication operation is not supported. | - | ERROR_OAUTH_UNSUPPORT_AUTH_TYPE | 10017 | The authentication type is not supported. | - | ERROR_PERMISSION_DENIED | 10018 | The required permission is missing. | +| Name | Default Value | Description | +| ----------------------------------- | ----- | ------------ | +| SUCCESS | 0 | The operation is successful. | +| ERROR_ACCOUNT_NOT_EXIST | 10001 | The app account does not exist. | +| ERROR_APP_ACCOUNT_SERVICE_EXCEPTION | 10002 | The app account service is abnormal. | +| ERROR_INVALID_PASSWORD | 10003 | The password is invalid. | +| ERROR_INVALID_REQUEST | 10004 | The request is invalid. | +| ERROR_INVALID_RESPONSE | 10005 | The response is invalid. | +| ERROR_NETWORK_EXCEPTION | 10006 | The network is abnormal. | +| ERROR_OAUTH_AUTHENTICATOR_NOT_EXIST | 10007 | The authenticator does not exist. | +| ERROR_OAUTH_CANCELED | 10008 | The authentication is canceled. | +| ERROR_OAUTH_LIST_TOO_LARGE | 10009 | The size of the OAuth list exceeds the limit. | +| ERROR_OAUTH_SERVICE_BUSY | 10010 | The OAuth service is busy. | +| ERROR_OAUTH_SERVICE_EXCEPTION | 10011 | The OAuth service is abnormal. | +| ERROR_OAUTH_SESSION_NOT_EXIST | 10012 | The session to be authenticated does not exist. | +| ERROR_OAUTH_TIMEOUT | 10013 | The authentication timed out. | +| ERROR_OAUTH_TOKEN_NOT_EXIST | 10014 | The OAuth access token does not exist.| +| ERROR_OAUTH_TOKEN_TOO_MANY | 10015 | The number of OAuth access tokens reaches the limit. | +| ERROR_OAUTH_UNSUPPORT_ACTION | 10016 | The authentication operation is not supported. | +| ERROR_OAUTH_UNSUPPORT_AUTH_TYPE | 10017 | The authentication type is not supported. | +| ERROR_PERMISSION_DENIED | 10018 | The required permission is missing. | ## AuthenticatorCallback8+ @@ -1656,10 +1656,10 @@ Called back to send the authentication result. **System capability**: SystemCapability.Account.AppAccount **Parameters** - | Name | Type | Mandatory | Description | - | ------ | -------------------- | ---- | ------ | - | code | number | Yes | Authentication result code. | - | result | {[key: string]: any} | Yes | Authentication result. | +| Name | Type | Mandatory | Description | +| ------ | -------------------- | ---- | ------ | +| code | number | Yes | Authentication result code.| +| result | {[key: string]: any} | Yes | Authentication result. | **Example** @@ -1686,9 +1686,9 @@ Called back to redirect an authentication request. **System capability**: SystemCapability.Account.AppAccount **Parameters** - | Name | Type | Mandatory | Description | - | ------- | ---- | ---- | ---------- | - | request | Want | Yes | Request to be redirected. | +| Name | Type | Mandatory | Description | +| ------- | ---- | ---- | ---------- | +| request | Want | Yes | Request to be redirected.| **Example** @@ -1718,34 +1718,34 @@ Defines the OAuth authenticator base class. addAccountImplicitly(authType: string, callerBundleName: string, options: {[key: string]: any}, callback: AuthenticatorCallback): void -Implicitly adds an app account based on the specified authentication type and options. This method uses an asynchronous callback to return the result. +Implicitly adds an app account based on the specified authentication type and options. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Account.AppAccount **Parameters** - | Name | Type | Mandatory | Description | - | ---------------- | --------------------- | ---- | --------------- | - | authType | string | Yes | Authentication type. | - | callerBundleName | string | Yes | Bundle name of the authentication requester. | - | options | {[key: string]: any} | Yes | Options for the authentication. | - | callback | AuthenticatorCallback | Yes | Authenticator callback invoked to return the authentication result. | +| Name | Type | Mandatory | Description | +| ---------------- | --------------------- | ---- | --------------- | +| authType | string | Yes | Authentication type. | +| callerBundleName | string | Yes | Bundle name of the authentication requester. | +| options | {[key: string]: any} | Yes | Options for the authentication. | +| callback | AuthenticatorCallback | Yes | Authenticator callback invoked to return the authentication result.| ### authenticate8+ authenticate(name: string, authType: string, callerBundleName: string, options: {[key: string]: any}, callback: AuthenticatorCallback): void -Authenticates an app account to obtain the OAuth access token. This method uses an asynchronous callback to return the result. +Authenticates an app account to obtain the OAuth access token. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Account.AppAccount **Parameters** - | Name | Type | Mandatory | Description | - | ---------------- | --------------------- | ---- | --------------- | - | name | string | Yes | App account name. | - | authType | string | Yes | Authentication type. | - | callerBundleName | string | Yes | Bundle name of the authentication requester. | - | options | {[key: string]: any} | Yes | Options for the authentication. | - | callback | AuthenticatorCallback | Yes | Authenticator callback invoked to return the authentication result. | +| Name | Type | Mandatory | Description | +| ---------------- | --------------------- | ---- | --------------- | +| name | string | Yes | App account name. | +| authType | string | Yes | Authentication type. | +| callerBundleName | string | Yes | Bundle name of the authentication requester. | +| options | {[key: string]: any} | Yes | Options for the authentication. | +| callback | AuthenticatorCallback | Yes | Authenticator callback invoked to return the authentication result.| **Example** @@ -1771,4 +1771,4 @@ Authenticates an app account to obtain the OAuth access token. This method uses return new MyAuthenticator(); } } - ``` \ No newline at end of file + ```