@onekeyfe/react-native-ping 3.0.162-alpha.272 → 3.0.163
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -0
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -1,5 +1,42 @@
|
|
|
1
1
|
# @onekeyfe/react-native-ping
|
|
2
2
|
|
|
3
|
+
Native ping diagnostics for OneKey React Native applications on iOS and
|
|
4
|
+
Android. The module exposes one asynchronous operation for a supplied IP
|
|
5
|
+
address with optional timeout and payload-size settings.
|
|
6
|
+
|
|
7
|
+
## Installation and usage
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
yarn add @onekeyfe/react-native-ping
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Install the application's iOS pods and rebuild the native application before
|
|
14
|
+
calling the TurboModule.
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
import { Ping } from '@onekeyfe/react-native-ping';
|
|
18
|
+
|
|
19
|
+
const result = await Ping.start('1.1.1.1', {});
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## API and integration
|
|
23
|
+
|
|
24
|
+
`start(ipAddress, { timeout?, payloadSize? })` returns `Promise<number>`.
|
|
25
|
+
`PingSpec` exports its TypeScript interface. The application supplies the target
|
|
26
|
+
IP address and owns retry, cancellation of its own surrounding workflow and
|
|
27
|
+
presentation of the diagnostic result.
|
|
28
|
+
|
|
29
|
+
Handle rejected promises and test network conditions on the target devices.
|
|
30
|
+
A ping result should not be used as proof that a particular HTTP endpoint,
|
|
31
|
+
TLS handshake or authenticated service request succeeds. Some networks restrict
|
|
32
|
+
ping independently of application traffic.
|
|
33
|
+
|
|
34
|
+
The wrapper is in [src/index.tsx](src/index.tsx), with the bridge defined in
|
|
35
|
+
[src/NativePing.ts](src/NativePing.ts). Native behavior remains platform-specific;
|
|
36
|
+
this wrapper does not add a continuous network monitor or a Web implementation.
|
|
37
|
+
|
|
38
|
+
## Upstream attribution
|
|
39
|
+
|
|
3
40
|
First, a sincere thank-you to the
|
|
4
41
|
`react-native-ping` maintainers for their excellent work 🙏
|
|
5
42
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/react-native-ping",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.163",
|
|
4
4
|
"description": "react-native-ping TurboModule for OneKey",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
|
@@ -37,14 +37,15 @@
|
|
|
37
37
|
],
|
|
38
38
|
"repository": {
|
|
39
39
|
"type": "git",
|
|
40
|
-
"url": "git+https://github.com/OneKeyHQ/app-modules
|
|
40
|
+
"url": "git+https://github.com/OneKeyHQ/app-modules.git",
|
|
41
|
+
"directory": "native-modules/react-native-ping"
|
|
41
42
|
},
|
|
42
43
|
"author": "@onekeyhq <huanming@onekey.so> (https://github.com/OneKeyHQ/app-modules)",
|
|
43
44
|
"license": "MIT",
|
|
44
45
|
"bugs": {
|
|
45
|
-
"url": "https://github.com/OneKeyHQ/app-modules/
|
|
46
|
+
"url": "https://github.com/OneKeyHQ/app-modules/issues"
|
|
46
47
|
},
|
|
47
|
-
"homepage": "https://github.com/OneKeyHQ/app-modules/react-native-ping#readme",
|
|
48
|
+
"homepage": "https://github.com/OneKeyHQ/app-modules/tree/main/native-modules/react-native-ping#readme",
|
|
48
49
|
"publishConfig": {
|
|
49
50
|
"registry": "https://registry.npmjs.org/"
|
|
50
51
|
},
|