提交 0ce30dfa 编写于 作者: A Annie_wang

update docs

Signed-off-by: NAnnie_wang <annie.wangli@huawei.com>
上级 c9f82184
...@@ -38,7 +38,7 @@ Obtains a **Preferences** instance. This API uses an asynchronous callback to re ...@@ -38,7 +38,7 @@ Obtains a **Preferences** instance. This API uses an asynchronous callback to re
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------ | ---- | ------------------------------------------------------------ | | -------- | ------------------------------------------------ | ---- | ------------------------------------------------------------ |
| context | Context | Yes | Application context.<br>For details about the application context of the FA model, see [Context](js-apis-inner-app-context.md).<br>For details about the application context of the stage model, see [Context](js-apis-ability-context.md). | | context | Context | Yes | Application context.<br>For details about the application context of the FA model, see [Context](js-apis-inner-app-context.md).<br>For details about the application context of the stage model, see [Context](js-apis-inner-application-uiAbilityContext.md). |
| name | string | Yes | Name of the **Preferences** instance.| | name | string | Yes | Name of the **Preferences** instance.|
| callback | AsyncCallback&lt;[Preferences](#preferences)&gt; | Yes | Callback invoked to return the result. If the operation is successful, **err** is **undefined** and **object** is the **Preferences** instance obtained. Otherwise, **err** is an error code.| | callback | AsyncCallback&lt;[Preferences](#preferences)&gt; | Yes | Callback invoked to return the result. If the operation is successful, **err** is **undefined** and **object** is the **Preferences** instance obtained. Otherwise, **err** is an error code.|
...@@ -55,39 +55,39 @@ let preferences = null; ...@@ -55,39 +55,39 @@ let preferences = null;
try { try {
data_preferences.getPreferences(context, 'mystore', function (err, val) { data_preferences.getPreferences(context, 'mystore', function (err, val) {
if (err) { if (err) {
console.info("Failed to get the preferences. code =" + err.code + ", message =" + err.message); console.info("Failed to obtain the preferences. code =" + err.code + ", message =" + err.message);
return; return;
} }
console.info("Got the preferences successfully."); preferences = val;
console.info("Obtained the preferences successfully.");
}) })
} catch (err) { } catch (err) {
console.info("Failed to get the preferences. code =" + err.code + ", message =" + err.message); console.info("Failed to obtain the preferences. code =" + err.code + ", message =" + err.message);
} }
``` ```
Stage model: Stage model:
```ts ```ts
// Obtain the context.
import UIAbility from '@ohos.app.ability.UIAbility'; import UIAbility from '@ohos.app.ability.UIAbility';
let context = null;
class EntryAbility extends UIAbility {
onWindowStageCreate(windowStage){
context = this.context;
}
}
let preferences = null; let preferences = null;
try {
data_preferences.getPreferences(context, 'mystore', function (err, val) { class EntryAbility extends UIAbility {
onWindowStageCreate(windowStage) {
try {
data_preferences.getPreferences(this.context, 'mystore', function (err, val) {
if (err) { if (err) {
console.info("Failed to get the preferences. code =" + err.code + ", message =" + err.message); console.info("Failed to obtain the preferences. code =" + err.code + ", message =" + err.message);
return; return;
} }
console.info("Got the preferences successfully."); preferences = val;
console.info("Obtained the preferences successfully.");
}) })
} catch (err) { } catch (err) {
console.info("Failed to get the preferences. code =" + err.code + ", message =" + err.message); console.info("Failed to obtain the preferences. code =" + err.code + ", message =" + err.message);
}
}
} }
``` ```
...@@ -103,7 +103,7 @@ Obtains a **Preferences** instance. This API uses a promise to return the result ...@@ -103,7 +103,7 @@ Obtains a **Preferences** instance. This API uses a promise to return the result
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ------- | ------------------------------------- | ---- | ----------------------- | | ------- | ------------------------------------- | ---- | ----------------------- |
| context | Context | Yes | Application context.<br>For details about the application context of the FA model, see [Context](js-apis-inner-app-context.md).<br>For details about the application context of the stage model, see [Context](js-apis-ability-context.md). | | context | Context | Yes | Application context.<br>For details about the application context of the FA model, see [Context](js-apis-inner-app-context.md).<br>For details about the application context of the stage model, see [Context](js-apis-inner-application-uiAbilityContext.md). |
| name | string | Yes | Name of the **Preferences** instance.| | name | string | Yes | Name of the **Preferences** instance.|
**Return value** **Return value**
...@@ -126,38 +126,36 @@ try { ...@@ -126,38 +126,36 @@ try {
let promise = data_preferences.getPreferences(context, 'mystore'); let promise = data_preferences.getPreferences(context, 'mystore');
promise.then((object) => { promise.then((object) => {
preferences = object; preferences = object;
console.info("Got the preferences successfully."); console.info("Obtained the preferences successfully.");
}).catch((err) => { }).catch((err) => {
console.log("Failed to get the preferences. code =" + err.code + ", message =" + err.message); console.info("Failed to obtain the preferences. code =" + err.code + ", message =" + err.message);
}) })
} catch(err) { } catch(err) {
console.log("Failed to get the preferences. code =" + err.code + ", message =" + err.message); console.info("Failed to obtain the preferences. code =" + err.code + ", message =" + err.message);
} }
``` ```
Stage model: Stage model:
```ts ```ts
// Obtain the context.
import UIAbility from '@ohos.app.ability.UIAbility'; import UIAbility from '@ohos.app.ability.UIAbility';
let context = null;
class EntryAbility extends UIAbility {
onWindowStageCreate(windowStage){
context = this.context;
}
}
let preferences = null; let preferences = null;
try {
let promise = data_preferences.getPreferences(context, 'mystore'); class EntryAbility extends UIAbility {
onWindowStageCreate(windowStage) {
try {
let promise = data_preferences.getPreferences(this.context, 'mystore');
promise.then((object) => { promise.then((object) => {
preferences = object; preferences = object;
console.info("Got the preferences successfully."); console.info("Obtained the preferences successfully.");
}).catch((err) => { }).catch((err) => {
console.log("Failed to get the preferences. code =" + err.code + ", message =" + err.message); console.info("Failed to obtain the preferences. code =" + err.code + ", message =" + err.message);
}) })
} catch(err) { } catch(err) {
console.log("Failed to get the preferences. code =" + err.code + ", message =" + err.message); console.info("Failed to obtain the preferences. code =" + err.code + ", message =" + err.message);
}
}
} }
``` ```
...@@ -177,7 +175,7 @@ The deleted **Preferences** instance cannot be used for data operations. Otherwi ...@@ -177,7 +175,7 @@ The deleted **Preferences** instance cannot be used for data operations. Otherwi
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------------------- | ---- | ---------------------------------------------------- | | -------- | ------------------------------------- | ---- | ---------------------------------------------------- |
| context | Context | Yes | Application context.<br>For details about the application context of the FA model, see [Context](js-apis-inner-app-context.md).<br>For details about the application context of the stage model, see [Context](js-apis-ability-context.md). | | context | Context | Yes | Application context.<br>For details about the application context of the FA model, see [Context](js-apis-inner-app-context.md).<br>For details about the application context of the stage model, see [Context](js-apis-inner-application-uiAbilityContext.md). |
| name | string | Yes | Name of the **Preferences** instance to delete. | | name | string | Yes | Name of the **Preferences** instance to delete. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked to return the result. If the operation is successful, **err** is **undefined**. Otherwise, **err** is an error code.| | callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked to return the result. If the operation is successful, **err** is **undefined**. Otherwise, **err** is an error code.|
...@@ -214,25 +212,22 @@ try { ...@@ -214,25 +212,22 @@ try {
Stage model: Stage model:
```ts ```ts
// Obtain the context.
import UIAbility from '@ohos.app.ability.UIAbility'; import UIAbility from '@ohos.app.ability.UIAbility';
let context = null;
class EntryAbility extends UIAbility {
onWindowStageCreate(windowStage){
context = this.context;
}
}
try { class EntryAbility extends UIAbility {
data_preferences.deletePreferences(context, 'mystore', function (err, val) { onWindowStageCreate(windowStage) {
try {
data_preferences.deletePreferences(this.context, 'mystore', function (err, val) {
if (err) { if (err) {
console.info("Failed to delete the preferences. code =" + err.code + ", message =" + err.message); console.info("Failed to delete the preferences. code =" + err.code + ", message =" + err.message);
return; return;
} }
console.info("Deleted the preferences successfully." ); console.info("Deleted the preferences successfully." );
}) })
} catch (err) { } catch (err) {
console.info("Failed to delete the preferences. code =" + err.code + ", message =" + err.message); console.info("Failed to delete the preferences. code =" + err.code + ", message =" + err.message);
}
}
} }
``` ```
...@@ -252,7 +247,7 @@ The deleted **Preferences** instance cannot be used for data operations. Otherwi ...@@ -252,7 +247,7 @@ The deleted **Preferences** instance cannot be used for data operations. Otherwi
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ------- | ------------------------------------- | ---- | ----------------------- | | ------- | ------------------------------------- | ---- | ----------------------- |
| context | Context | Yes | Application context.<br>For details about the application context of the FA model, see [Context](js-apis-inner-app-context.md).<br>For details about the application context of the stage model, see [Context](js-apis-ability-context.md). | | context | Context | Yes | Application context.<br>For details about the application context of the FA model, see [Context](js-apis-inner-app-context.md).<br>For details about the application context of the stage model, see [Context](js-apis-inner-application-uiAbilityContext.md). |
| name | string | Yes | Name of the **Preferences** instance to delete.| | name | string | Yes | Name of the **Preferences** instance to delete.|
**Return value** **Return value**
...@@ -293,24 +288,21 @@ try { ...@@ -293,24 +288,21 @@ try {
Stage model: Stage model:
```ts ```ts
// Obtain the context.
import UIAbility from '@ohos.app.ability.UIAbility'; import UIAbility from '@ohos.app.ability.UIAbility';
let context = null;
class EntryAbility extends UIAbility {
onWindowStageCreate(windowStage){
context = this.context;
}
}
try{ class EntryAbility extends UIAbility {
let promise = data_preferences.deletePreferences(context, 'mystore'); onWindowStageCreate(windowStage) {
try{
let promise = data_preferences.deletePreferences(this.context, 'mystore');
promise.then(() => { promise.then(() => {
console.info("Deleted the preferences successfully."); console.info("Deleted the preferences successfully.");
}).catch((err) => { }).catch((err) => {
console.info("Failed to delete the preferences. code =" + err.code + ", message =" + err.message); console.info("Failed to delete the preferences. code =" + err.code + ", message =" + err.message);
}) })
} catch(err) { } catch(err) {
console.info("Failed to delete the preferences. code =" + err.code + ", message =" + err.message); console.info("Failed to delete the preferences. code =" + err.code + ", message =" + err.message);
}
}
} }
``` ```
...@@ -328,7 +320,7 @@ The removed **Preferences** instance cannot be used for data operations. Otherwi ...@@ -328,7 +320,7 @@ The removed **Preferences** instance cannot be used for data operations. Otherwi
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------------------- | ---- | ---------------------------------------------------- | | -------- | ------------------------------------- | ---- | ---------------------------------------------------- |
| context | Context | Yes | Application context.<br>For details about the application context of the FA model, see [Context](js-apis-inner-app-context.md).<br>For details about the application context of the stage model, see [Context](js-apis-ability-context.md). | | context | Context | Yes | Application context.<br>For details about the application context of the FA model, see [Context](js-apis-inner-app-context.md).<br>For details about the application context of the stage model, see [Context](js-apis-inner-application-uiAbilityContext.md). |
| name | string | Yes | Name of the **Preferences** instance to remove. | | name | string | Yes | Name of the **Preferences** instance to remove. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked to return the result. If the operation is successful, **err** is **undefined**. Otherwise, **err** is an error code.| | callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked to return the result. If the operation is successful, **err** is **undefined**. Otherwise, **err** is an error code.|
...@@ -357,25 +349,22 @@ try { ...@@ -357,25 +349,22 @@ try {
Stage model: Stage model:
```ts ```ts
// Obtain the context.
import UIAbility from '@ohos.app.ability.UIAbility'; import UIAbility from '@ohos.app.ability.UIAbility';
let context = null;
class EntryAbility extends UIAbility {
onWindowStageCreate(windowStage){
context = this.context;
}
}
try { class EntryAbility extends UIAbility {
data_preferences.removePreferencesFromCache(context, 'mystore', function (err, val) { onWindowStageCreate(windowStage) {
try {
data_preferences.removePreferencesFromCache(this.context, 'mystore', function (err, val) {
if (err) { if (err) {
console.info("Failed to remove the preferences. code =" + err.code + ", message =" + err.message); console.info("Failed to remove the preferences. code =" + err.code + ", message =" + err.message);
return; return;
} }
console.info("Removed the preferences successfully."); console.info("Removed the preferences successfully.");
}) })
} catch (err) { } catch (err) {
console.info("Failed to remove the preferences. code =" + err.code + ", message =" + err.message); console.info("Failed to remove the preferences. code =" + err.code + ", message =" + err.message);
}
}
} }
``` ```
...@@ -394,7 +383,7 @@ The removed **Preferences** instance cannot be used for data operations. Otherwi ...@@ -394,7 +383,7 @@ The removed **Preferences** instance cannot be used for data operations. Otherwi
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ------- | ------------------------------------- | ---- | ----------------------- | | ------- | ------------------------------------- | ---- | ----------------------- |
| context | Context | Yes | Application context.<br>For details about the application context of the FA model, see [Context](js-apis-inner-app-context.md).<br>For details about the application context of the stage model, see [Context](js-apis-ability-context.md). | | context | Context | Yes | Application context.<br>For details about the application context of the FA model, see [Context](js-apis-inner-app-context.md).<br>For details about the application context of the stage model, see [Context](js-apis-inner-application-uiAbilityContext.md). |
| name | string | Yes | Name of the **Preferences** instance to remove.| | name | string | Yes | Name of the **Preferences** instance to remove.|
**Return value** **Return value**
...@@ -427,24 +416,21 @@ try { ...@@ -427,24 +416,21 @@ try {
Stage model: Stage model:
```ts ```ts
// Obtain the context.
import UIAbility from '@ohos.app.ability.UIAbility'; import UIAbility from '@ohos.app.ability.UIAbility';
let context = null;
class EntryAbility extends UIAbility {
onWindowStageCreate(windowStage){
context = this.context;
}
}
try { class EntryAbility extends UIAbility {
let promise = data_preferences.removePreferencesFromCache(context, 'mystore'); onWindowStageCreate(windowStage) {
try {
let promise = data_preferences.removePreferencesFromCache(this.context, 'mystore');
promise.then(() => { promise.then(() => {
console.info("Removed the preferences successfully."); console.info("Removed the preferences successfully.");
}).catch((err) => { }).catch((err) => {
console.info("Failed to remove the preferences. code =" + err.code + ", message =" + err.message); console.info("Failed to remove the preferences. code =" + err.code + ", message =" + err.message);
}) })
} catch(err) { } catch(err) {
console.info("Failed to remove the preferences. code =" + err.code + ", message =" + err.message); console.info("Failed to remove the preferences. code =" + err.code + ", message =" + err.message);
}
}
} }
``` ```
...@@ -459,7 +445,7 @@ Before calling any method of **Preferences**, you must obtain a **Preferences** ...@@ -459,7 +445,7 @@ Before calling any method of **Preferences**, you must obtain a **Preferences**
get(key: string, defValue: ValueType, callback: AsyncCallback&lt;ValueType&gt;): void get(key: string, defValue: ValueType, callback: AsyncCallback&lt;ValueType&gt;): void
Obtains the value of a key. This API uses an asynchronous callback to return the result. If the value is **null** or is not the type of the default value, the default value is returned. Obtains the value of a key. This API uses an asynchronous callback to return the result. If the value is **null** or is not of the default value type, **defValue** is returned.
**System capability**: SystemCapability.DistributedDataManager.Preferences.Core **System capability**: SystemCapability.DistributedDataManager.Preferences.Core
...@@ -477,13 +463,13 @@ Obtains the value of a key. This API uses an asynchronous callback to return the ...@@ -477,13 +463,13 @@ Obtains the value of a key. This API uses an asynchronous callback to return the
try { try {
preferences.get('startup', 'default', function (err, val) { preferences.get('startup', 'default', function (err, val) {
if (err) { if (err) {
console.info("Failed to get the value of 'startup'. code =" + err.code + ", message =" + err.message); console.info("Failed to obtain the value of 'startup'. code =" + err.code + ", message =" + err.message);
return; return;
} }
console.info("Obtained the value of 'startup' successfully. val: " + val); console.info("Obtained the value of 'startup' successfully. val: " + val);
}) })
} catch (err) { } catch (err) {
console.info("Failed to get the value of 'startup'. code =" + err.code + ", message =" + err.message); console.info("Failed to obtain the value of 'startup'. code =" + err.code + ", message =" + err.message);
} }
``` ```
...@@ -492,7 +478,7 @@ try { ...@@ -492,7 +478,7 @@ try {
get(key: string, defValue: ValueType): Promise&lt;ValueType&gt; get(key: string, defValue: ValueType): Promise&lt;ValueType&gt;
Obtains the value of a key. This API uses a promise to return the result. If the value is **null** or is not the type of the default value, the default value is returned. Obtains the value of a key. This API uses a promise to return the result. If the value is **null** or is not of the default value type, **defValue** is returned.
**System capability**: SystemCapability.DistributedDataManager.Preferences.Core **System capability**: SystemCapability.DistributedDataManager.Preferences.Core
...@@ -520,7 +506,7 @@ try { ...@@ -520,7 +506,7 @@ try {
console.info("Failed to get value of 'startup'. code =" + err.code + ", message =" + err.message); console.info("Failed to get value of 'startup'. code =" + err.code + ", message =" + err.message);
}) })
} catch(err) { } catch(err) {
console.info("Failed to get the value of 'startup'. code =" + err.code + ", message =" + err.message); console.info("Failed to obtain the value of 'startup'. code =" + err.code + ", message =" + err.message);
} }
``` ```
...@@ -794,10 +780,10 @@ try { ...@@ -794,10 +780,10 @@ try {
promise.then(() => { promise.then(() => {
console.info("Deleted the key 'startup'."); console.info("Deleted the key 'startup'.");
}).catch((err) => { }).catch((err) => {
console.log("Failed to delete the key 'startup'. code =" + err.code +", message =" + err.message); console.info("Failed to delete the key 'startup'. code =" + err.code +", message =" + err.message);
}) })
} catch(err) { } catch(err) {
console.log("Failed to delete the key 'startup'. code =" + err.code +", message =" + err.message); console.info("Failed to delete the key 'startup'. code =" + err.code +", message =" + err.message);
} }
``` ```
...@@ -945,7 +931,7 @@ Subscribes to data changes. A callback will be triggered to return the new value ...@@ -945,7 +931,7 @@ Subscribes to data changes. A callback will be triggered to return the new value
try { try {
data_preferences.getPreferences(this.context, 'mystore', function (err, preferences) { data_preferences.getPreferences(this.context, 'mystore', function (err, preferences) {
if (err) { if (err) {
console.info("Failed to get the preferences."); console.info("Failed to obtain the preferences.");
return; return;
} }
let observer = function (key) { let observer = function (key) {
...@@ -987,7 +973,7 @@ Unsubscribes from data changes. ...@@ -987,7 +973,7 @@ Unsubscribes from data changes.
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | -------------------------------- | ---- | ------------------------------------------ | | -------- | -------------------------------- | ---- | ------------------------------------------ |
| type | string | Yes | Event type to unsubscribe from. The value **change** indicates data change events. | | type | string | Yes | Event type to unsubscribe from. The value **change** indicates data change events. |
| callback | Callback&lt;{ key : string }&gt; | No | Callback to unregister. If this parameter is left blank, all callbacks for data changes will be unregistered. | | callback | Callback&lt;{ key : string }&gt; | No | Callback to unregister. If this parameter is left blank, the callbacks used to subscribing to all data changes will be unregistered.|
**Example** **Example**
...@@ -995,7 +981,7 @@ Unsubscribes from data changes. ...@@ -995,7 +981,7 @@ Unsubscribes from data changes.
try { try {
data_preferences.getPreferences(this.context, 'mystore', function (err, preferences) { data_preferences.getPreferences(this.context, 'mystore', function (err, preferences) {
if (err) { if (err) {
console.info("Failed to get the preferences."); console.info("Failed to obtain the preferences.");
return; return;
} }
let observer = function (key) { let observer = function (key) {
......
# @ohos.data.storage # @ohos.data.storage (Lightweight Data Storage)
The **DataStorage** module provides applications with data processing capability and allows applications to perform lightweight data storage and query. Data is stored in key-value (KV) pairs. Keys are of the string type, and values can be of the number, string, or Boolean type. The **DataStorage** module provides applications with data processing capability and allows applications to perform lightweight data storage and query. Data is stored in key-value (KV) pairs. Keys are of the string type, and values can be of the number, string, or Boolean type.
...@@ -367,7 +367,7 @@ Provides APIs for obtaining and modifying storage data. ...@@ -367,7 +367,7 @@ Provides APIs for obtaining and modifying storage data.
getSync(key: string, defValue: ValueType): ValueType getSync(key: string, defValue: ValueType): ValueType
Obtains the value corresponding to a key. If the value is null or not in the default value format, the default value is returned. Obtains the value corresponding to a key. If the value is null or not of the default value type, **defValue** is returned.
**System capability**: SystemCapability.DistributedDataManager.Preferences.Core **System capability**: SystemCapability.DistributedDataManager.Preferences.Core
...@@ -396,7 +396,7 @@ console.info("The value of startup is " + value); ...@@ -396,7 +396,7 @@ console.info("The value of startup is " + value);
get(key: string, defValue: ValueType, callback: AsyncCallback&lt;ValueType&gt;): void get(key: string, defValue: ValueType, callback: AsyncCallback&lt;ValueType&gt;): void
Obtains the value corresponding to a key. If the value is null or not in the default value format, the default value is returned. This API uses an asynchronous callback to return the result. Obtains the value corresponding to a key. If the value is null or not of the default value type, **defValue** is returned. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.DistributedDataManager.Preferences.Core **System capability**: SystemCapability.DistributedDataManager.Preferences.Core
...@@ -425,7 +425,7 @@ storage.get('startup', 'default', function(err, value) { ...@@ -425,7 +425,7 @@ storage.get('startup', 'default', function(err, value) {
get(key: string, defValue: ValueType): Promise&lt;ValueType&gt; get(key: string, defValue: ValueType): Promise&lt;ValueType&gt;
Obtains the value corresponding to a key. If the value is null or not in the default value format, the default value is returned. This API uses a promise to return the result. Obtains the value corresponding to a key. If the value is null or not of the default value type, **defValue** is returned. This API uses a promise to return the result.
**System capability**: SystemCapability.DistributedDataManager.Preferences.Core **System capability**: SystemCapability.DistributedDataManager.Preferences.Core
......
...@@ -14,7 +14,7 @@ The **PermissionRequestResult** module defines the result of a permission reques ...@@ -14,7 +14,7 @@ The **PermissionRequestResult** module defines the result of a permission reques
| Name| Type| Readable| Writable| Description| | Name| Type| Readable| Writable| Description|
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| permissions | Array&lt;string&gt; | Yes| No| Permissions requested.| | permissions | Array&lt;string&gt; | Yes| No| Permissions requested.|
| authResults | Array&lt;number&gt; | Yes| No|Resule of the permission Request.<br>**-1**: The permission has been set and no dialog box will be displayed. Users can modify the permission in **Settings**.<br>**0**: No operation is required.<br>**1**: Dynamic user authorization is required via a dialog window .<br>**2**: The request is invalid. Possible causes are as follows:<br>- The permission is not declared in the configuration file.<br>- The permission name is invalid.<br>- Special conditions for applying for the permission do not satisfied. See [ohos.permission.LOCATION](../../security/permission-list.md#ohospermissionlocation) and [ohos.permission.APPROXIMATELY_LOCATION](../../security/permission-list.md#ohospermissionapproximately_location).| | authResults | Array&lt;number&gt; | Yes| No|Result of the permission Request.<br>**-1**: The permission has been set and no dialog box will be displayed. Users can modify the permission in **Settings**.<br>**0**: No operation is required.<br>**1**: Dynamic user authorization is required via a dialog window .<br>**2**: The request is invalid. Possible causes are as follows:<br>- The permission is not declared in the configuration file.<br>- The permission name is invalid.<br>- Special conditions for applying for the permission do not satisfied. See [ohos.permission.LOCATION](../../security/permission-list.md#ohospermissionlocation) and [ohos.permission.APPROXIMATELY_LOCATION](../../security/permission-list.md#ohospermissionapproximately_location).|
## Usage ## Usage
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册