diff --git a/en/application-dev/reference/apis/js-apis-appAccount.md b/en/application-dev/reference/apis/js-apis-appAccount.md
index 0d2aef3e25aa21eb724c8f74f977d901ea12b290..7c2974d0c8fc4eef7a911523fdeb96c596304c94 100644
--- a/en/application-dev/reference/apis/js-apis-appAccount.md
+++ b/en/application-dev/reference/apis/js-apis-appAccount.md
@@ -1,4 +1,4 @@
-# @ohos.account.appAccount
+# @ohos.account.appAccount (App Account Management)
The **appAccount** module provides APIs for adding, deleting, modifying, and querying app account information, and supports inter-app authentication and distributed data synchronization.
@@ -64,7 +64,6 @@ Creates an app account. This API uses an asynchronous callback to return the res
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
try {
appAccountManager.createAccount("WangWu", (err) => {
console.log("createAccount err: " + JSON.stringify(err));
@@ -102,7 +101,6 @@ Creates an app account with custom data. This API uses an asynchronous callback
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
let options = {
customData: {
"age": "10"
@@ -155,7 +153,6 @@ Creates an app account with custom data. This API uses a promise to return the r
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
let options = {
customData: {
"age": "10"
@@ -215,7 +212,6 @@ Creates an app account implicitly based on the specified account owner. This API
});
}
- let appAccountManager = account_appAccount.createAppAccountManager();
try {
appAccountManager.createAccountImplicitly("com.example.accountjsdemo", {
onResult: onResultCallback,
@@ -270,7 +266,6 @@ Creates an app account implicitly based on the specified account owner and optio
});
}
- let appAccountManager = account_appAccount.createAppAccountManager();
let options = {
authType: "getSocialData",
requiredLabels: [ "student" ]
@@ -311,7 +306,6 @@ Removes an app account. This API uses an asynchronous callback to return the res
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
try {
appAccountManager.removeAccount("ZhaoLiu", (err) => {
if (err) {
@@ -356,7 +350,6 @@ Removes an app account. This API uses a promise to return the result.
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
try {
appAccountManager.removeAccount("Lisi").then(() => {
console.log("removeAccount successfully");
@@ -397,7 +390,6 @@ Sets the access to the data of an account for an app. This API uses an asynchron
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
try {
appAccountManager.setAppAccess("ZhangSan", "com.example.accountjsdemo", true, (err) => {
if (err) {
@@ -445,7 +437,6 @@ Sets the access to the data of an account for an app. This API uses a promise to
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
try {
appAccountManager.setAppAccess("ZhangSan", "com.example.accountjsdemo", true).then(() => {
console.log("setAppAccess successfully");
@@ -485,7 +476,6 @@ Checks whether an app can access the data of an account. This API uses an asynch
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
try {
appAccountManager.checkAppAccess("ZhangSan", "com.example.accountjsdemo", (err, isAccessible) => {
if (err) {
@@ -532,7 +522,6 @@ Checks whether an app can access the data of an account. This API uses a promise
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
try {
appAccountManager.checkAppAccess("ZhangSan", "com.example.accountjsdemo").then((isAccessible) => {
console.log("checkAppAccess successfully, isAccessible: " + isAccessible);
@@ -573,7 +562,6 @@ Sets data synchronization for an app account. This API uses an asynchronous call
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
try {
appAccountManager.setDataSyncEnabled("ZhangSan", true, (err) => {
console.log("setDataSyncEnabled err: " + JSON.stringify(err));
@@ -617,7 +605,6 @@ Sets data synchronization for an app account. This API uses a promise to return
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
try {
appAccountManager .setDataSyncEnabled("ZhangSan", true).then(() => {
console.log('setDataSyncEnabled Success');
@@ -657,7 +644,6 @@ Checks whether data synchronization is enabled for an app account. This API uses
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
try {
appAccountManager.checkDataSyncEnabled("ZhangSan", (err, isEnabled) => {
if (err) {
@@ -704,7 +690,6 @@ Checks whether data synchronization is enabled for an app account. This API uses
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
try {
appAccountManager.checkDataSyncEnabled("ZhangSan").then((isEnabled) => {
console.log("checkDataSyncEnabled successfully, isEnabled: " + isEnabled);
@@ -744,7 +729,6 @@ Sets a credential for an app account. This API uses an asynchronous callback to
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
try {
appAccountManager.setCredential("ZhangSan", "PIN_SIX", "xxxxxx", (err) => {
if (err) {
@@ -791,7 +775,6 @@ Sets a credential for an app account. This API uses a promise to return the resu
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
try {
appAccountManager.setCredential("ZhangSan", "PIN_SIX", "xxxxxx").then(() => {
console.log("setCredential successfully");
@@ -831,7 +814,6 @@ Obtains the credential of an app account. This API uses an asynchronous callback
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
try {
appAccountManager.getCredential("ZhangSan", "PIN_SIX", (err, result) => {
if (err) {
@@ -878,7 +860,6 @@ Obtains the credential of an app account. This API uses a promise to return the
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
try {
appAccountManager.getCredential("ZhangSan", "PIN_SIX").then((credential) => {
console.log("getCredential successfully, credential: " + credential);
@@ -919,7 +900,6 @@ Sets custom data for an app account. This API uses an asynchronous callback to r
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
try {
appAccountManager.setCustomData("ZhangSan", "age", "12", (err) => {
if (err) {
@@ -967,7 +947,6 @@ Sets custom data for an app account. This API uses a promise to return the resul
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
try {
appAccountManager.setCustomData("ZhangSan", "age", "12").then(() => {
console.log("setCustomData successfully");
@@ -1007,7 +986,6 @@ Obtains the custom data of an app account based on the specified key. This API u
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
try {
appAccountManager.getCustomData("ZhangSan", "age", (err, data) => {
if (err) {
@@ -1054,7 +1032,6 @@ Obtains the custom data of an app account based on the specified key. This API u
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
try {
appAccountManager.getCustomData("ZhangSan", "age").then((data) => {
console.log("getCustomData successfully, data: " + data);
@@ -1099,7 +1076,6 @@ Obtains the custom data of an app account based on the specified key. The API re
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
try {
let value = appAccountManager.getCustomDataSync("ZhangSan", "age");
console.info("getCustomDataSync successfully, vaue:" + value);
@@ -1114,8 +1090,7 @@ getAllAccounts(callback: AsyncCallback<Array<AppAccountInfo>>): void
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
-
+**Required Permissions**: ohos.permission.GET_ALL_APP_ACCOUNTS
**System capability**: SystemCapability.Account.AppAccount
**Parameters**
@@ -1133,7 +1108,6 @@ Obtains information about all accessible app accounts. This API uses an asynchro
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
try {
appAccountManager.getAllAccounts((err, data) => {
if (err) {
@@ -1153,8 +1127,7 @@ getAllAccounts(): Promise<Array<AppAccountInfo>>
Obtains information about all accessible app accounts. This API uses a promise to return the result.
-**Required permissions**: ohos.permission.GET_ALL_APP_ACCOUNTS
-
+**Required Permissions**: ohos.permission.GET_ALL_APP_ACCOUNTS
**System capability**: SystemCapability.Account.AppAccount
**Return value**
@@ -1172,7 +1145,6 @@ Obtains information about all accessible app accounts. This API uses a promise t
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
try {
appAccountManager.getAllAccounts().then((data) => {
console.debug("getAllAccounts successfully");
@@ -1190,8 +1162,7 @@ getAccountsByOwner(owner: string, callback: AsyncCallback<Array<AppAccount
Obtains the app accounts that can be accessed by the invoker based on the app account owner. This API uses an asynchronous callback to return the result.
-**Required permissions**: ohos.permission.GET_ALL_APP_ACCOUNTS
-
+**Required Permissions**: ohos.permission.GET_ALL_APP_ACCOUNTS
**System capability**: SystemCapability.Account.AppAccount
**Parameters**
@@ -1212,7 +1183,6 @@ Obtains the app accounts that can be accessed by the invoker based on the app ac
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
try {
appAccountManager.getAccountsByOwner("com.example.accountjsdemo2", (err, data) => {
if (err) {
@@ -1232,8 +1202,7 @@ getAccountsByOwner(owner: string): Promise<Array<AppAccountInfo>>
Obtains the app accounts that can be accessed by the invoker based on the app account owner. This API uses a promise to return the result.
-**Required permissions**: ohos.permission.GET_ALL_APP_ACCOUNTS
-
+**Required Permissions**: ohos.permission.GET_ALL_APP_ACCOUNTS
**System capability**: SystemCapability.Account.AppAccount
**Parameters**
@@ -1259,7 +1228,6 @@ Obtains the app accounts that can be accessed by the invoker based on the app ac
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
try {
appAccountManager.getAccountsByOwner("com.example.accountjsdemo2").then((data) => {
console.debug("getAccountsByOwner successfully, data:" + JSON.stringify(data));
@@ -1299,7 +1267,6 @@ Subscribes to account information changes of apps.
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
function changeOnCallback(data){
console.log("receive change data:" + JSON.stringify(data));
}
@@ -1336,8 +1303,7 @@ Unsubscribes from account information changes.
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
- function changeOnCallback(data){
+ function changeOnCallback(data) {
console.log("receive change data:" + JSON.stringify(data));
}
try{
@@ -1398,7 +1364,6 @@ Authenticates an app account. This API uses an asynchronous callback to return t
});
}
- let appAccountManager = account_appAccount.createAppAccountManager();
try {
appAccountManager.auth("LiSi", "com.example.accountjsdemo", "getSocialData", {
onResult: onResultCallback,
@@ -1458,7 +1423,6 @@ Authenticates an app account with customized options. This API uses an asynchron
let options = {
"password": "xxxx",
};
- let appAccountManager = account_appAccount.createAppAccountManager();
try {
appAccountManager.auth("LiSi", "com.example.accountjsdemo", "getSocialData", options, {
onResult: onResultCallback,
@@ -1498,7 +1462,6 @@ Obtains the authorization token of the specified authentication type for an app
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
try {
appAccountManager.getAuthToken("LiSi", "com.example.accountjsdemo", "getSocialData", (err, token) => {
if (err) {
@@ -1546,7 +1509,6 @@ Obtains the authorization token of the specified authentication type for an app
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
try {
appAccountManager.getAuthToken("LiSi", "com.example.accountjsdemo", "getSocialData").then((token) => {
console.log("getAuthToken successfully, token: " + token);
@@ -1587,7 +1549,6 @@ Sets an authorization token of the specific authentication type for an app accou
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
try {
appAccountManager.setAuthToken("LiSi", "getSocialData", "xxxx", (err) => {
if (err) {
@@ -1635,7 +1596,6 @@ Sets an authorization token of the specific authentication type for an app accou
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
try {
appAccountManager.setAuthToken("LiSi", "getSocialData", "xxxx").then(() => {
console.log("setAuthToken successfully");
@@ -1677,7 +1637,6 @@ Deletes the authorization token of the specified authentication type for an app
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
try {
appAccountManager.deleteAuthToken("LiSi", "com.example.accountjsdemo", "getSocialData", "xxxxx", (err) => {
if (err) {
@@ -1726,7 +1685,6 @@ Deletes the authorization token of the specified authentication type for an app
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
try {
appAccountManager.deleteAuthToken("LiSi", "com.example.accountjsdemo", "getSocialData", "xxxxx").then(() => {
console.log("deleteAuthToken successfully");
@@ -1770,7 +1728,6 @@ Sets the visibility of an authorization token to an app. This API uses an asynch
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
try {
appAccountManager.setAuthTokenVisibility("LiSi", "getSocialData", "com.example.accountjsdemo", true, (err) => {
if (err) {
@@ -1821,7 +1778,6 @@ Sets the visibility of an authorization token to an app. This API uses a promise
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
try {
appAccountManager.setAuthTokenVisibility("LiSi", "getSocialData", "com.example.accountjsdemo", true).then(() => {
console.log("setAuthTokenVisibility successfully");
@@ -1863,7 +1819,6 @@ Checks the visibility of an authorization token of the specified authentication
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
try {
appAccountManager.checkAuthTokenVisibility("LiSi", "getSocialData", "com.example.accountjsdemo", (err, isVisible) => {
if (err) {
@@ -1912,7 +1867,6 @@ Checks the visibility of an authorization token of the specified authentication
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
try {
appAccountManager.checkAuthTokenVisibility("LiSi", "getSocialData", "com.example.accountjsdemo").then((isVisible) => {
console.log("checkAuthTokenVisibility successfully, isVisible: " + isVisible);
@@ -1951,7 +1905,6 @@ Obtains all tokens visible to the invoker for an app account. This API uses an a
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
try {
appAccountManager.getAllAuthTokens("LiSi", "com.example.accountjsdemo", (err, tokenArr) => {
if (err) {
@@ -1997,7 +1950,6 @@ Obtains all tokens visible to the invoker for an app account. This API uses a pr
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
try {
appAccountManager.getAllAuthTokens("LiSi", "com.example.accountjsdemo").then((tokenArr) => {
console.log('getAllAuthTokens successfully, tokenArr: ' + JSON.stringify(tokenArr));
@@ -2037,7 +1989,6 @@ Obtains the authorization list of the specified authentication type for an app a
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
try {
appAccountManager.getAuthList("com.example.accountjsdemo", "getSocialData", (err, authList) => {
if (err) {
@@ -2084,7 +2035,6 @@ Obtains the authorization list of the specified authentication type for an app a
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
try {
appAccountManager.getAuthList("com.example.accountjsdemo", "getSocialData").then((authList) => {
console.log("getAuthList successfully, authList: " + authList);
@@ -2123,7 +2073,6 @@ Obtains the authenticator callback for the authentication session. This API uses
```js
import featureAbility from '@ohos.ability.featureAbility';
- let appAccountManager = account_appAccount.createAppAccountManager();
featureAbility.getWant((err, want) => {
var sessionId = want.parameters[account_appAccount.Constants.KEY_SESSION_ID];
try {
@@ -2183,7 +2132,6 @@ Obtains the authenticator callback for the authentication session. This API uses
```js
import featureAbility from '@ohos.ability.featureAbility';
- let appAccountManager = account_appAccount.createAppAccountManager();
featureAbility.getWant().then((want) => {
var sessionId = want.parameters[account_appAccount.Constants.KEY_SESSION_ID];
try {
@@ -2236,7 +2184,6 @@ Obtains the authenticator information of an app. This API uses an asynchronous c
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
try {
appAccountManager.queryAuthenticatorInfo("com.example.accountjsdemo", (err, info) => {
if (err) {
@@ -2281,7 +2228,6 @@ Obtains the authenticator information of an app. This API uses a promise to retu
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
try {
appAccountManager.queryAuthenticatorInfo("com.example.accountjsdemo").then((info) => {
console.log("queryAuthenticatorInfo successfully, info: " + JSON.stringify(info));
@@ -2324,7 +2270,6 @@ Checks whether an app account has specific labels. This API uses an asynchronous
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
let labels = ["student"];
try {
appAccountManager.checkAccountLabels("zhangsan", "com.example.accountjsdemo", labels, (err, hasAllLabels) => {
@@ -2375,7 +2320,6 @@ Checks whether an app account has specific labels. This API uses a promise to re
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
let labels = ["student"];
try {
appAccountManager.checkAccountLabels("zhangsan", "com.example.accountjsdemo", labels).then((hasAllLabels) => {
@@ -2416,7 +2360,6 @@ Deletes the credential of the specified type from an app account. This API uses
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
try {
appAccountManager.deleteCredential("zhangsan", "PIN_SIX", (err) => {
if (err) {
@@ -2463,7 +2406,6 @@ Deletes the credential of the specified type from an app account. This API uses
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
try {
appAccountManager.deleteCredential("zhangsan", "PIN_SIX").then(() => {
console.log("deleteCredential successfully");
@@ -2502,7 +2444,6 @@ Selects the accounts that can be accessed by the invoker based on the options. T
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
let options = {
allowedOwners: [ "com.example.accountjsdemo" ],
requiredLabels: [ "student" ]
@@ -2552,7 +2493,6 @@ Selects the accounts that can be accessed by the invoker based on the options. T
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
let options = {
allowedOwners: ["com.example.accountjsdemo"]
};
@@ -2597,7 +2537,6 @@ Verifies the credential of an app account. This API uses an asynchronous callbac
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
try {
appAccountManager.verifyCredential("zhangsan", "com.example.accountjsdemo", {
onResult: (resultCode, result) => {
@@ -2644,7 +2583,6 @@ Verifies the user credential. This API uses an asynchronous callback to return t
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
let options = {
credentialType: "pin",
credential: "123456"
@@ -2692,7 +2630,6 @@ Sets the authenticator attributes of an app. This API uses an asynchronous callb
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
try {
appAccountManager.setAuthenticatorProperties("com.example.accountjsdemo", {
onResult: (resultCode, result) => {
@@ -2737,7 +2674,6 @@ Set authenticator properties. This API uses an asynchronous callback to return t
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
let options = {
properties: {"prop1": "value1"}
};
@@ -2780,7 +2716,6 @@ Adds an app account. This API uses an asynchronous callback to return the result
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
appAccountManager.addAccount("WangWu", (err) => {
console.log("addAccount err: " + JSON.stringify(err));
});
@@ -2809,7 +2744,6 @@ Adds an app account name and additional information. This API uses an asynchrono
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
appAccountManager.addAccount("LiSi", "token101", (err) => {
console.log("addAccount err: " + JSON.stringify(err));
});
@@ -2843,7 +2777,6 @@ Adds an app account name and additional information. This API uses an asynchrono
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
appAccountManager.addAccount("LiSi", "token101").then(()=> {
console.log('addAccount Success');
}).catch((err) => {
@@ -2889,7 +2822,6 @@ Adds an app account implicitly based on the specified owner. This API uses an as
});
}
- let appAccountManager = account_appAccount.createAppAccountManager();
appAccountManager.addAccountImplicitly("com.example.accountjsdemo", "getSocialData", {}, {
onResult: onResultCallback,
onRequestRedirected: onRequestRedirectedCallback
@@ -2918,7 +2850,6 @@ Deletes an app account. This API uses an asynchronous callback to return the res
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
appAccountManager.deleteAccount("ZhaoLiu", (err) => {
console.log("deleteAccount err: " + JSON.stringify(err));
});
@@ -2951,7 +2882,6 @@ Deletes an app account. This API uses a promise to return the result.
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
appAccountManager.deleteAccount("ZhaoLiu").then(() => {
console.log('deleteAccount Success');
}).catch((err) => {
@@ -2981,7 +2911,6 @@ Disables an app account from accessing an app. This API uses an asynchronous cal
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
appAccountManager.disableAppAccess("ZhangSan", "com.example.accountjsdemo", (err) => {
console.log("disableAppAccess err: " + JSON.stringify(err));
});
@@ -3015,7 +2944,6 @@ Disables an app account from accessing an app. This API uses a promise to return
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
appAccountManager.disableAppAccess("ZhangSan", "com.example.accountjsdemo").then(() => {
console.log('disableAppAccess Success');
}).catch((err) => {
@@ -3046,7 +2974,6 @@ Enables an app account to access an app. This API uses an asynchronous callback
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
appAccountManager.enableAppAccess("ZhangSan", "com.example.accountjsdemo", (err) => {
console.log("enableAppAccess: " + JSON.stringify(err));
});
@@ -3080,7 +3007,6 @@ Enables an app account to access an app. This API uses a promise to return the r
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
appAccountManager.enableAppAccess("ZhangSan", "com.example.accountjsdemo").then(() => {
console.log('enableAppAccess Success');
}).catch((err) => {
@@ -3112,7 +3038,6 @@ Checks whether data synchronization is enabled for an app account. This API uses
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
appAccountManager.checkAppAccountSyncEnable("ZhangSan", (err, result) => {
console.log("checkAppAccountSyncEnable err: " + JSON.stringify(err));
console.log('checkAppAccountSyncEnable result: ' + result);
@@ -3148,7 +3073,6 @@ Checks whether data synchronization is enabled for an app account. This API uses
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
appAccountManager.checkAppAccountSyncEnable("ZhangSan").then((data) => {
console.log('checkAppAccountSyncEnable, result: ' + data);
}).catch((err) => {
@@ -3180,7 +3104,6 @@ Set credentials for an app account. This API uses an asynchronous callback to re
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
appAccountManager.setAccountCredential("ZhangSan", "credentialType001", "credential001", (err) => {
console.log("setAccountCredential err: " + JSON.stringify(err));
});
@@ -3215,7 +3138,6 @@ Set credentials for an app account. This API uses a promise to return the result
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
appAccountManager.setAccountCredential("ZhangSan", "credentialType001", "credential001").then(() => {
console.log('setAccountCredential Success');
}).catch((err) => {
@@ -3247,7 +3169,6 @@ Sets additional information for an app account. This API uses an asynchronous ca
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
appAccountManager.setAccountExtraInfo("ZhangSan", "Tk002", (err) => {
console.log("setAccountExtraInfo err: " + JSON.stringify(err));
});
@@ -3282,7 +3203,6 @@ Sets additional information for an app account. This API uses a promise to retur
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
appAccountManager.setAccountExtraInfo("ZhangSan", "Tk002").then(() => {
console.log('setAccountExtraInfo Success');
}).catch((err) => {
@@ -3315,7 +3235,6 @@ Sets data synchronization for an app account. This API uses an asynchronous call
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
appAccountManager.setAppAccountSyncEnable("ZhangSan", true, (err) => {
console.log("setAppAccountSyncEnable err: " + JSON.stringify(err));
});
@@ -3351,7 +3270,6 @@ Sets data synchronization for an app account. This API uses a promise to return
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
appAccountManager .setAppAccountSyncEnable("ZhangSan", true).then(() => {
console.log('setAppAccountSyncEnable Success');
}).catch((err) => {
@@ -3384,7 +3302,6 @@ Sets data to be associated with an app account. This API uses an asynchronous ca
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
appAccountManager.setAssociatedData("ZhangSan", "k001", "v001", (err) => {
console.log("setAssociatedData err: " + JSON.stringify(err));
});
@@ -3420,7 +3337,6 @@ Sets data to be associated with an app account. This API uses a promise to retur
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
appAccountManager.setAssociatedData("ZhangSan", "k001", "v001").then(() => {
console.log('setAssociatedData Success');
}).catch((err) => {
@@ -3451,7 +3367,6 @@ Obtains information about all accessible app accounts. This API uses an asynchro
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
appAccountManager.getAllAccessibleAccounts((err, data)=>{
console.debug("getAllAccessibleAccounts err:" + JSON.stringify(err));
console.debug("getAllAccessibleAccounts data:" + JSON.stringify(data));
@@ -3481,7 +3396,6 @@ Obtains information about all accessible app accounts. This API uses a promise t
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
appAccountManager.getAllAccessibleAccounts().then((data) => {
console.log('getAllAccessibleAccounts: ' + data);
}).catch((err) => {
@@ -3513,7 +3427,6 @@ Obtains the app accounts that can be accessed by the invoker based on the app ac
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
const selfBundle = "com.example.actsgetallaaccounts";
appAccountManager.getAllAccounts(selfBundle, (err, data)=>{
console.debug("getAllAccounts err:" + JSON.stringify(err));
@@ -3550,7 +3463,6 @@ Obtains the app accounts that can be accessed by the invoker based on the app ac
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
const selfBundle = "com.example.actsgetallaaccounts";
appAccountManager.getAllAccounts(selfBundle).then((data) => {
console.log('getAllAccounts: ' + data);
@@ -3582,7 +3494,6 @@ Obtains the credential of an app account. This API uses an asynchronous callback
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
appAccountManager.getAccountCredential("ZhangSan", "credentialType001", (err, result) => {
console.log("getAccountCredential err: " + JSON.stringify(err));
console.log('getAccountCredential result: ' + result);
@@ -3617,7 +3528,6 @@ Obtains the credential of an app account. This API uses a promise to return the
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
appAccountManager.getAccountCredential("ZhangSan", "credentialType001").then((data) => {
console.log('getAccountCredential, result: ' + data);
}).catch((err) => {
@@ -3647,7 +3557,6 @@ Obtains additional information of an app account. Additional information refers
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
appAccountManager.getAccountExtraInfo("ZhangSan", (err, result) => {
console.log("getAccountExtraInfo err: " + JSON.stringify(err));
console.log('getAccountExtraInfo result: ' + result);
@@ -3681,7 +3590,6 @@ Obtains additional information of an app account. Additional information refers
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
appAccountManager.getAccountExtraInfo("ZhangSan").then((data) => {
console.log('getAccountExtraInfo, result: ' + data);
}).catch((err) => {
@@ -3712,7 +3620,6 @@ Obtains data associated with an app account. This API uses an asynchronous callb
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
appAccountManager.getAssociatedData("ZhangSan", "k001", (err, result) => {
console.log("getAssociatedData err: " + JSON.stringify(err));
console.log('getAssociatedData result: ' + result);
@@ -3747,7 +3654,6 @@ Obtains data associated with an app account. This API uses a promise to return t
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
appAccountManager.getAssociatedData("ZhangSan", "k001").then((data) => {
console.log('getAssociatedData: ' + data);
}).catch((err) => {
@@ -3778,7 +3684,6 @@ Subscribes to account information changes of apps.
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
function changeOnCallback(data){
console.debug("receive change data:" + JSON.stringify(data));
}
@@ -3812,7 +3717,6 @@ Unsubscribes from account information changes.
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
function changeOnCallback(data){
console.debug("receive change data:" + JSON.stringify(data));
appAccountManager.off('change', function(){
@@ -3866,7 +3770,6 @@ Authenticates an app account with customized options. This API uses an asynchron
});
}
- let appAccountManager = account_appAccount.createAppAccountManager();
appAccountManager.authenticate("LiSi", "com.example.accountjsdemo", "getSocialData", {}, {
onResult: onResultCallback,
onRequestRedirected: onRequestRedirectedCallback
@@ -3897,7 +3800,6 @@ Obtains the authorization token of the specified authentication type for an app
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
appAccountManager.getOAuthToken("LiSi", "com.example.accountjsdemo", "getSocialData", (err, data) => {
console.log('getOAuthToken err: ' + JSON.stringify(err));
console.log('getOAuthToken token: ' + data);
@@ -3933,7 +3835,6 @@ Obtains the authorization token of the specified authentication type for an app
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
appAccountManager.getOAuthToken("LiSi", "com.example.accountjsdemo", "getSocialData").then((data) => {
console.log('getOAuthToken token: ' + data);
}).catch((err) => {
@@ -3965,7 +3866,6 @@ Sets an authorization token of the specific authentication type for an app accou
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
appAccountManager.setOAuthToken("LiSi", "getSocialData", "xxxx", (err) => {
console.log('setOAuthToken err: ' + JSON.stringify(err));
});
@@ -4000,7 +3900,6 @@ Sets an authorization token of the specific authentication type for an app accou
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
appAccountManager.setOAuthToken("LiSi", "getSocialData", "xxxx").then(() => {
console.log('setOAuthToken successfully');
}).catch((err) => {
@@ -4033,7 +3932,6 @@ Deletes the authorization token of the specified authentication type for an app
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
appAccountManager.deleteOAuthToken("LiSi", "com.example.accountjsdemo", "getSocialData", "xxxxx", (err) => {
console.log('deleteOAuthToken err: ' + JSON.stringify(err));
});
@@ -4069,7 +3967,6 @@ Deletes the authorization token of the specified authentication type for an app
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
appAccountManager.deleteOAuthToken("LiSi", "com.example.accountjsdemo", "getSocialData", "xxxxx").then(() => {
console.log('deleteOAuthToken successfully');
}).catch((err) => {
@@ -4102,7 +3999,6 @@ Sets the visibility of an authorization token to an app. This API uses an asynch
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
appAccountManager.setOAuthTokenVisibility("LiSi", "getSocialData", "com.example.accountjsdemo", true, (err) => {
console.log('setOAuthTokenVisibility err: ' + JSON.stringify(err));
});
@@ -4138,7 +4034,6 @@ Sets the visibility of an authorization token to an app. This API uses a promise
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
appAccountManager.setOAuthTokenVisibility("LiSi", "getSocialData", "com.example.accountjsdemo", true).then(() => {
console.log('setOAuthTokenVisibility successfully');
}).catch((err) => {
@@ -4170,7 +4065,6 @@ Checks the visibility of an authorization token of the specified authentication
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
appAccountManager.checkOAuthTokenVisibility("LiSi", "getSocialData", "com.example.accountjsdemo", (err, data) => {
console.log('checkOAuthTokenVisibility err: ' + JSON.stringify(err));
console.log('checkOAuthTokenVisibility isVisible: ' + data);
@@ -4206,7 +4100,6 @@ Checks the visibility of an authorization token of the specified authentication
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
appAccountManager.checkOAuthTokenVisibility("LiSi", "getSocialData", "com.example.accountjsdemo").then((data) => {
console.log('checkOAuthTokenVisibility isVisible: ' + data);
}).catch((err) => {
@@ -4237,7 +4130,6 @@ Obtains all tokens visible to the invoker for an app account. This API uses an a
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
appAccountManager.getAllOAuthTokens("LiSi", "com.example.accountjsdemo", (err, data) => {
console.log("getAllOAuthTokens err: " + JSON.stringify(err));
console.log('getAllOAuthTokens data: ' + JSON.stringify(data));
@@ -4272,7 +4164,6 @@ Obtains all tokens visible to the invoker for an app account. This API uses a pr
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
appAccountManager.getAllOAuthTokens("LiSi", "com.example.accountjsdemo").then((data) => {
console.log('getAllOAuthTokens data: ' + JSON.stringify(data));
}).catch((err) => {
@@ -4303,7 +4194,6 @@ Obtains the authorization list of the specified authentication type for an app a
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
appAccountManager.getOAuthList("com.example.accountjsdemo", "getSocialData", (err, data) => {
console.log('getOAuthList err: ' + JSON.stringify(err));
console.log('getOAuthList data: ' + JSON.stringify(data));
@@ -4338,7 +4228,6 @@ Obtains the authorization list of the specified authentication type for an app a
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
appAccountManager.getOAuthList("com.example.accountjsdemo", "getSocialData").then((data) => {
console.log('getOAuthList data: ' + JSON.stringify(data));
}).catch((err) => {
@@ -4369,7 +4258,6 @@ Obtains the authenticator callback for an authentication session. This API uses
```js
import featureAbility from '@ohos.ability.featureAbility';
- let appAccountManager = account_appAccount.createAppAccountManager();
featureAbility.getWant((err, want) => {
var sessionId = want.parameters[account_appAccount.Constants.KEY_SESSION_ID];
appAccountManager.getAuthenticatorCallback(sessionId, (err, callback) => {
@@ -4415,7 +4303,6 @@ Obtains the authenticator callback for an authentication session. This API uses
```js
import featureAbility from '@ohos.ability.featureAbility';
- let appAccountManager = account_appAccount.createAppAccountManager();
featureAbility.getWant().then((want) => {
var sessionId = want.parameters[account_appAccount.Constants.KEY_SESSION_ID];
appAccountManager.getAuthenticatorCallback(sessionId).then((callback) => {
@@ -4454,7 +4341,6 @@ Obtains the authenticator information of an app. This API uses an asynchronous c
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
appAccountManager.getAuthenticatorInfo("com.example.accountjsdemo", (err, data) => {
console.log("getAuthenticatorInfo err: " + JSON.stringify(err));
console.log('getAuthenticatorInfo data: ' + JSON.stringify(data));
@@ -4488,7 +4374,6 @@ Obtains the authenticator information of an app. This API uses a promise to retu
**Example**
```js
- let appAccountManager = account_appAccount.createAppAccountManager();
appAccountManager.getAuthenticatorInfo("com.example.accountjsdemo").then((data) => {
console.log('getAuthenticatorInfo: ' + JSON.stringify(data));
}).catch((err) => {
@@ -4883,7 +4768,7 @@ Creates an app account implicitly based on the specified account owner. This API
| options | [CreateAccountImplicitlyOptions](#createaccountimplicitlyoptions9) | Yes | Options for implicitly creating the account. |
| callback | [AuthCallback](#authcallback9) | Yes | Authenticator callback invoked to return the result.|
-### addAccountImplicitlydeprecated
+### addAccountImplicitly(deprecated)
addAccountImplicitly(authType: string, callerBundleName: string, options: {[key: string]: any}, callback: AuthenticatorCallback): void
@@ -4922,7 +4807,7 @@ Authenticates an app account to obtain the authorization token. This API uses an
| options | {[key: string]: Object} | Yes | Options for the authentication. |
| callback | [AuthCallback](#authcallback9) | Yes | Callback invoked to return the result.|
-### authenticatedeprecated
+### authenticate(deprecated)
authenticate(name: string, authType: string, callerBundleName: string, options: {[key: string]: any}, callback: AuthenticatorCallback): void
diff --git a/en/application-dev/security/permission-list.md b/en/application-dev/security/permission-list.md
index 279a3a223407f068f06075e16347f9b472505992..f3e380bbfd572a2bd159801f8fecee60af5e681b 100644
--- a/en/application-dev/security/permission-list.md
+++ b/en/application-dev/security/permission-list.md
@@ -534,9 +534,9 @@ Allows an application to change the telephone state.
**Enable ACL**: TRUE
-## ohos.permission.START_ABILIIES_FROM_BACKGROUND
+## ohos.permission.START_ABILITIES_FROM_BACKGROUND
-Allows an application to start Feature abilities in the background.
+Allows an application to start or access other components from the background.
**Permission level**: system_basic