From 6ecec1691e58e594b06b5e3fd6884576041daeba Mon Sep 17 00:00:00 2001 From: chenwenhui133 <2984202073@qq.com> Date: Sat, 7 Mar 2026 14:33:33 +0800 Subject: [PATCH 1/2] =?UTF-8?q?docs:=20[Issues:=20#IE6HIL]=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9react-native-ping=E4=B8=89=E6=96=B9=E5=BA=93=E6=96=87?= =?UTF-8?q?=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- en/react-native-ping.md | 23 +++++++---------------- zh-cn/react-native-ping.md | 26 ++++++++------------------ 2 files changed, 15 insertions(+), 34 deletions(-) diff --git a/en/react-native-ping.md b/en/react-native-ping.md index 9aa1f5d7..a63bae0b 100644 --- a/en/react-native-ping.md +++ b/en/react-native-ping.md @@ -524,17 +524,14 @@ This document is verified based on the following versions: ### 3.2 Permission Requirements (Enter the related permission configuration.) -open `entry/src/main/resources/base/element/string.json` and add: + Add in ` entry/src/main/module. json 5 ` -```diff -... -{ - "string": [ -+ { -+ "name": "ohos.permission.INTERNET", -+ }, - ] -} +```json +requestPermissions: [ + { + name: "ohos.permission.INTERNET", + }, +], ``` ### 3.3. API requirements @@ -568,9 +565,3 @@ open `entry/src/main/resources/base/element/string.json` and add: - [ ] The options configuration for the start method is not taking effect - [ ] The error code only supports PingUtil_Message_HostErrorNotSetHost and PingUtil_Message_HostErrorUnknown; others are not supported - -## 6. Others - -## 7. License - -This project is licensed under [MIT License (MIT)](). diff --git a/zh-cn/react-native-ping.md b/zh-cn/react-native-ping.md index 6c264a7e..f313077e 100644 --- a/zh-cn/react-native-ping.md +++ b/zh-cn/react-native-ping.md @@ -527,20 +527,17 @@ ohpm install 1. RNOH: 0.72.59/0.77.18-1/0.82.7; SDK: HarmonyOS-6.0.0(API20); IDE: DevEco Studio 6.0.1.260; ROM: NEXT.0.0.71。 -### 3.2. 权限要求(如有) +### 3.2. 权限要求 (填入相关权限配置) -打开 `entry/src/main/resources/base/element/string.json`,添加: + 在`entry/src/main/module.json5`中添加 -```diff -... -{ - "string": [ -+ { -+ "name": "ohos.permission.INTERNET", -+ }, - ] -} +```json +requestPermissions: [ + { + name: "ohos.permission.INTERNET", + }, +], ``` ### 3.3. 编译运行API要求 @@ -585,10 +582,3 @@ ohpm install - [ ] start方法的options配置不生效 - [ ] 错误码只支持PingUtil_Message_HostErrorNotSetHost和PingUtil_Message_HostErrorUnknown,其他不支持 - -## 8. 其他 - - -## 9. 开源协议 - -本项目基于 [MIT License (MIT)]() ,请自由地享受和参与开源。 -- Gitee From 0d634efc6934a7ee0366c3f0e6da5bc6779efe49 Mon Sep 17 00:00:00 2001 From: chenwenhui133 <2984202073@qq.com> Date: Mon, 9 Mar 2026 14:48:23 +0800 Subject: [PATCH 2/2] =?UTF-8?q?docs:=20[Issues:=20#IE6HIL]=20=E6=9B=B4?= =?UTF-8?q?=E6=96=B0react-native-ping=E4=B8=89=E6=96=B9=E5=BA=93=E7=9A=84?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- en/react-native-ping.md | 15 ++++++++++++++- zh-cn/react-native-ping.md | 14 ++++++++------ 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/en/react-native-ping.md b/en/react-native-ping.md index a63bae0b..6c39fba8 100644 --- a/en/react-native-ping.md +++ b/en/react-native-ping.md @@ -48,7 +48,7 @@ import { ActivityIndicator, Alert, } from 'react-native'; -import Ping from '@react-native-ohos/react-native-ping'; +import Ping from 'react-native-ping'; const TestCase = ({ title, @@ -561,7 +561,20 @@ requestPermissions: [ | receivedNetworkTotal | Download Total | string | yes | ALL | yes | | sendNetworkTotal | Upload Total | string | yes | ALL | yes | +### errors + +| Name | Description | Type | default | platform | HarmonyOS Support | +| :------- | :----------- | :------: | :---------: | -------- | ----------------- | +| PingUtil_Message_Timeout | timeout | `string` | `0` | iOS,Android | NO | +| PingUtil_Message_PreviousPingIsStillRunning | running | `string` | `1` | / | NO | +| PingUtil_Message_HostErrorNotSetHost | not set host | `string` | `2` | iOS,Android | YES | +| PingUtil_Message_HostErrorUnknown | host error unknown | `string` | `3` | iOS,Android | YES | +| PingUtil_Message_HostErrorHostNotFound | host not found | `string` | `4` | Only iOS | NO | +| PingUtil_Message_Unknown | nnknown | `string` | `5` | Only iOS | NO | + ## 5. Known Issues - [ ] The options configuration for the start method is not taking effect - [ ] The error code only supports PingUtil_Message_HostErrorNotSetHost and PingUtil_Message_HostErrorUnknown; others are not supported + +## 6. Others diff --git a/zh-cn/react-native-ping.md b/zh-cn/react-native-ping.md index f313077e..c394f164 100644 --- a/zh-cn/react-native-ping.md +++ b/zh-cn/react-native-ping.md @@ -51,7 +51,7 @@ import { ActivityIndicator, Alert, } from 'react-native'; -import Ping from '@react-native-ohos/react-native-ping'; +import Ping from 'react-native-ping'; const TestCase = ({ title, @@ -547,7 +547,7 @@ requestPermissions: [ > [!TIP] 以下功能依赖特定版本的API,使用 `低于指定API版本的工程编译` 或 `低于指定API版本的ROM运行` 均可能导致部分功能受限。 1. 1.0.0版本引入[NetConn_ProbeResultInfo](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/capi-netconnection-netconn-proberesultinfo),来定义ping功能中返回的探测结果信息,NetConn_ProbeResultInfo需要在支持`API20+`的工程编译,并在支持`API20+`的ROM上运行,低版本上运行将会导致start方法中的ping功能不可用。 -## 6. API +## 4. API > [!TIP] "Platform"列表示该属性在原三方库上支持的平台。 @@ -567,18 +567,20 @@ requestPermissions: [ | receivedNetworkTotal | 接收总量 | string | yes | ALL | yes | | sendNetworkTotal | 发送总量 | string | yes | ALL | yes | -## 7. 错误码 +### 错误码 | Name | Description | Type | default | platform | HarmonyOS Support | | :------- | :----------- | :------: | :---------: | -------- | ----------------- | -| PingUtil_Message_Timeout | 超时 | `string` | `0` | iOS,Android | NO | +| PingUtil_Message_Timeout | 超时 | `string` | `0` | iOS,Android | NO | | PingUtil_Message_PreviousPingIsStillRunning | 正在运行 | `string` | `1` | / | NO | | PingUtil_Message_HostErrorNotSetHost | 未设置ip | `string` | `2` | iOS,Android | YES | | PingUtil_Message_HostErrorUnknown | host未知错误 | `string` | `3` | iOS,Android | YES | -| PingUtil_Message_HostErrorHostNotFound | host错误、host找不到| `string` | `4` | Only iOS | NO | +| PingUtil_Message_HostErrorHostNotFound | host找不到 | `string` | `4` | Only iOS | NO | | PingUtil_Message_Unknown | 未知错误 | `string` | `5` | Only iOS | NO | -## 7. 遗留问题 +## 5. 遗留问题 - [ ] start方法的options配置不生效 - [ ] 错误码只支持PingUtil_Message_HostErrorNotSetHost和PingUtil_Message_HostErrorUnknown,其他不支持 + +## 6. 其他 \ No newline at end of file -- Gitee