diff --git a/en/application-dev/reference/apis/js-apis-system-network.md b/en/application-dev/reference/apis/js-apis-system-network.md index a0b69a4dba4644451020ec49368117bcb1e98f91..e012487feefe73e79738c570e4e2ebda9ad23919 100644 --- a/en/application-dev/reference/apis/js-apis-system-network.md +++ b/en/application-dev/reference/apis/js-apis-system-network.md @@ -33,22 +33,15 @@ Obtains the network type. | Name | Type | Mandatory | Description | | -------- | -------- | -------- | -------- | -| success | Function | No | Called when the execution is successful. | -| fail | Function | No | Called when the operation fails. | -| complete | Function | No | Called when the execution is complete | +| success | Function | No | Called when the execution is successful. The return value is [NetworkResponse](#networkresponse). | +| fail | Function | No | Called when the operation fails. | +| complete | Function | No | Called when the execution is complete | -The following value will be returned when the multimedia volume is obtained. +Return value of the **fail** callback: -| Parameter | Type | Description | -| -------- | -------- | -------- | -| metered | boolean | Whether the billing is based on the data volume. | -| type | string | Network type. The value can be **2G**, **3G**, **4G**, **5G**, **WiFi**, or **none**. | - -One of the following error codes will be returned if the operation fails. - -| Error Code | Description | +| Error Code | Description | | -------- | -------- | -| 602 | The current permission is not declared. | +| 602 | The current permission is not declared. | **Example** @@ -80,22 +73,15 @@ Listens to the network connection state. If this method is called multiple times | Name | Type | Mandatory | Description | | -------- | -------- | -------- | -------- | -| success | Function | No | Called when the network connection state changes | -| fail | Function | No | Called when the multimedia volume fails to be obtained. | +| success | Function | No | Called when the network connection state changes | +| fail | Function | No | Called when the multimedia volume fails to be obtained. | -The following value will be returned when the multimedia volume is obtained. - -| Parameter | Type | Description | -| -------- | -------- | -------- | -| metered | boolean | Whether the billing is based on the data volume. | -| type | string | Network type. The value can be **2G**, **3G**, **4G**, **5G**, **WiFi**, or **none**. | +Return value of the **fail** callback: -One of the following error codes will be returned if the listening fails. - -| Error Code | Description | +| Error Code | Description | | -------- | -------- | -| 602 | The current permission is not declared. | -| 200 | The subscription fails. | +| 602 | The current permission is not declared. | +| 200 | The subscription fails. | **Example** @@ -131,4 +117,11 @@ export default { network.unsubscribe(); }, } -``` \ No newline at end of file +``` + +## NetworkResponse + +| Parameter | Type | Description | +| -------- | -------- | -------- | +| metered | boolean | Whether the billing is based on the data volume. | +| type | string | Network type. The value can be **2G**, **3G**, **4G**, **5G**, **WiFi**, or **none**. | \ No newline at end of file