@onekeyfe/react-native-device-utils 3.0.162 → 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.
Files changed (2) hide show
  1. package/README.md +51 -0
  2. package/package.json +6 -5
package/README.md ADDED
@@ -0,0 +1,51 @@
1
+ # @onekeyfe/react-native-device-utils
2
+
3
+ Native application and device integration utilities for OneKey on iOS and
4
+ Android. The Nitro interface groups launch information, display and system-bar
5
+ appearance, device tokens, boot recovery and platform-service inspection.
6
+ These are host integration helpers rather than a portable browser device API.
7
+
8
+ ## Installation
9
+
10
+ ```sh
11
+ yarn add @onekeyfe/react-native-device-utils react-native-nitro-modules
12
+ ```
13
+
14
+ Install the application's iOS pods and rebuild the native application. Features
15
+ such as push tokens and launch options also require the application's native
16
+ host configuration; installing this package does not register those services.
17
+
18
+ ## Usage
19
+
20
+ ```ts
21
+ import { ReactNativeDeviceUtils } from '@onekeyfe/react-native-device-utils';
22
+
23
+ const launch = await ReactNativeDeviceUtils.getLaunchOptions();
24
+ const startupTime = await ReactNativeDeviceUtils.getStartupTime();
25
+ const installer = ReactNativeDeviceUtils.getInstallerPackageName();
26
+ ```
27
+
28
+ ## API groups
29
+
30
+ - Display: dual-screen status, window/hinge rectangles, background color and
31
+ interface style.
32
+ - Android navigation bar: `setNavigationBarAppearance(r, g, b, a, useDarkIcons)`.
33
+ Color channels use 0–255; this method is a no-op on iOS.
34
+ - Launch and notifications: read/clear launch options, register/store device
35
+ tokens and consume cold-start local notification data.
36
+ - Android services: WebView package information, Google Play Services status,
37
+ distribution channel and installer identification.
38
+ - Boot recovery: mark boot success, inspect/update failure counts and consume
39
+ a pending recovery action.
40
+
41
+ Spanning listeners return IDs that must be removed when their owner finishes.
42
+ Cold-start local notification consumption is meaningful on iOS; Android returns
43
+ an empty string. Platform-specific results should not be interpreted as a
44
+ cross-platform guarantee that a service or hardware feature is available.
45
+
46
+ See [src/ReactNativeDeviceUtils.nitro.ts](src/ReactNativeDeviceUtils.nitro.ts)
47
+ for the complete signatures, enum values and platform notes.
48
+
49
+ ## License
50
+
51
+ MIT.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@onekeyfe/react-native-device-utils",
3
- "version": "3.0.162",
4
- "description": "react-native-device-utils",
3
+ "version": "3.0.163",
4
+ "description": "Native device, launch, system appearance and boot recovery utilities for OneKey",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
7
7
  "exports": {
@@ -50,14 +50,15 @@
50
50
  ],
51
51
  "repository": {
52
52
  "type": "git",
53
- "url": "git+https://github.com/OneKeyHQ/app-modules/react-native-device-utils.git"
53
+ "url": "git+https://github.com/OneKeyHQ/app-modules.git",
54
+ "directory": "native-modules/react-native-device-utils"
54
55
  },
55
56
  "author": "onekeyfe <huanming@onekey.so> (https://github.com/OneKeyHQ/app-modules)",
56
57
  "license": "MIT",
57
58
  "bugs": {
58
- "url": "https://github.com/OneKeyHQ/app-modules/react-native-device-utils/issues"
59
+ "url": "https://github.com/OneKeyHQ/app-modules/issues"
59
60
  },
60
- "homepage": "https://github.com/OneKeyHQ/app-modules/react-native-device-utils#readme",
61
+ "homepage": "https://github.com/OneKeyHQ/app-modules/tree/main/native-modules/react-native-device-utils#readme",
61
62
  "publishConfig": {
62
63
  "registry": "https://registry.npmjs.org/"
63
64
  },