@onekeyfe/react-native-network-info 3.0.157-alpha.275 → 3.0.157-alpha.276

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.
Files changed (2) hide show
  1. package/README.md +38 -0
  2. package/package.json +5 -4
package/README.md CHANGED
@@ -1,5 +1,43 @@
1
1
  # @onekeyfe/react-native-network-info
2
2
 
3
+ Native network information queries for OneKey on iOS and Android. The
4
+ TurboModule exposes device network addresses and Wi-Fi-related values; it does
5
+ not initiate a connection or monitor reachability continuously.
6
+
7
+ ## Installation and usage
8
+
9
+ ```sh
10
+ yarn add @onekeyfe/react-native-network-info
11
+ ```
12
+
13
+ Install the application's iOS pods and rebuild the native application. Configure
14
+ any platform permissions needed for the network information your consumer uses.
15
+
16
+ ```ts
17
+ import { NetworkInfo } from '@onekeyfe/react-native-network-info';
18
+
19
+ const address = await NetworkInfo.getIPAddress();
20
+ const ssid = await NetworkInfo.getSSID();
21
+ ```
22
+
23
+ ## API and results
24
+
25
+ Address methods include `getIPAddress`, `getIPV4Address`, `getIPV6Address`,
26
+ `getWIFIIPV4Address`, `getGatewayIPAddress` and `getSubnet`.
27
+ `getSSID`, `getBSSID` and `getBroadcast` return nullable strings;
28
+ `getFrequency` returns a nullable number.
29
+
30
+ Availability depends on the platform, network and permission state. Handle
31
+ missing values and promise failures rather than assuming Wi-Fi data is always
32
+ present. An address or SSID is not evidence that Internet access is available.
33
+ The application owns refresh frequency and interpretation of returned values.
34
+
35
+ See [src/NativeNetworkInfo.ts](src/NativeNetworkInfo.ts) for the full interface.
36
+ The package exports the native object as `NetworkInfo` and its type as
37
+ `NetworkInfoSpec`.
38
+
39
+ ## Upstream attribution
40
+
3
41
  First, a sincere thank-you to the
4
42
  `react-native-network-info` maintainers for their excellent work 🙏
5
43
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/react-native-network-info",
3
- "version": "3.0.157-alpha.275",
3
+ "version": "3.0.157-alpha.276",
4
4
  "description": "react-native-network-info",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
@@ -45,14 +45,15 @@
45
45
  ],
46
46
  "repository": {
47
47
  "type": "git",
48
- "url": "git+https://github.com/OneKeyHQ/app-modules/react-native-network-info.git"
48
+ "url": "git+https://github.com/OneKeyHQ/app-modules.git",
49
+ "directory": "native-modules/react-native-network-info"
49
50
  },
50
51
  "author": "@onekeyhq <huanming@onekey.so> (https://github.com/OneKeyHQ/app-modules)",
51
52
  "license": "MIT",
52
53
  "bugs": {
53
- "url": "https://github.com/OneKeyHQ/app-modules/react-native-network-info/issues"
54
+ "url": "https://github.com/OneKeyHQ/app-modules/issues"
54
55
  },
55
- "homepage": "https://github.com/OneKeyHQ/app-modules/react-native-network-info#readme",
56
+ "homepage": "https://github.com/OneKeyHQ/app-modules/tree/main/native-modules/react-native-network-info#readme",
56
57
  "publishConfig": {
57
58
  "registry": "https://registry.npmjs.org/"
58
59
  },