react-native-navigation-mode 1.2.0-beta.2 → 1.2.0
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 +50 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
🧭 Detect Android navigation mode (3-button, 2-button, or gesture navigation) with native precision using Turbo modules.
|
|
4
4
|
|
|
5
|
-
[](https://badge.fury.io/js/react-native-navigation-mode) [](https://github.com/JairajJangle/react-native-navigation-mode/blob/main/LICENSE) [](https://github.com/JairajJangle/react-native-navigation-mode/actions/workflows/ci.yml)   [](https://github.com/JairajJangle/react-native-navigation-mode/issues?q=is%3Aopen+is%3Aissue)   
|
|
5
|
+
[](https://badge.fury.io/js/react-native-navigation-mode) [](https://github.com/JairajJangle/react-native-navigation-mode/blob/main/LICENSE) [](https://github.com/JairajJangle/react-native-navigation-mode/actions/workflows/ci.yml)   [](https://github.com/JairajJangle/react-native-navigation-mode/issues?q=is%3Aopen+is%3Aissue)    
|
|
6
6
|
|
|
7
7
|
<table align="center">
|
|
8
8
|
<tr>
|
|
@@ -45,11 +45,14 @@
|
|
|
45
45
|
- 📦 **Zero Dependencies** - Lightweight and performant
|
|
46
46
|
- 🛡️ **TypeScript** - Full type safety out of the box
|
|
47
47
|
- ↕️ **Edge To Edge Support** - Full support for `react-native-edge-to-edge`
|
|
48
|
+
- 📲 **Expo Support** - Works with Expo SDK 52+ managed workflow and development builds
|
|
48
49
|
|
|
49
50
|
## 🚀 Quick Start
|
|
50
51
|
|
|
51
52
|
### Installation
|
|
52
53
|
|
|
54
|
+
#### React Native (Bare Workflow)
|
|
55
|
+
|
|
53
56
|
Using yarn:
|
|
54
57
|
|
|
55
58
|
```sh
|
|
@@ -64,6 +67,44 @@ npm install react-native-navigation-mode
|
|
|
64
67
|
|
|
65
68
|
> **Note:** Auto-linking should handle setup automatically for all newer RN versions.
|
|
66
69
|
|
|
70
|
+
#### Expo (Managed Workflow)
|
|
71
|
+
|
|
72
|
+
```sh
|
|
73
|
+
npx expo install react-native-navigation-mode
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
##### Expo Configuration
|
|
77
|
+
|
|
78
|
+
Add the plugin to your `app.json` or `app.config.ts`:
|
|
79
|
+
|
|
80
|
+
```json
|
|
81
|
+
{
|
|
82
|
+
"expo": {
|
|
83
|
+
"plugins": [
|
|
84
|
+
"react-native-navigation-mode"
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
For bare workflow or custom native code, you'll need to prebuild:
|
|
91
|
+
|
|
92
|
+
```sh
|
|
93
|
+
npx expo prebuild
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
##### Development Builds
|
|
97
|
+
|
|
98
|
+
Since this library contains native code, it requires a custom development build. You cannot use it with standard Expo Go.
|
|
99
|
+
|
|
100
|
+
#### Requirements
|
|
101
|
+
|
|
102
|
+
- **React Native**: 0.77.0+
|
|
103
|
+
- **Expo SDK**: 52+ (for managed workflow)
|
|
104
|
+
- **Android**: API 21+ (Android 5.0+)
|
|
105
|
+
- **iOS**: Any version (returns gesture navigation)
|
|
106
|
+
- **New Architecture**: Required (enabled by default in RN 0.77+ and Expo SDK 52+)
|
|
107
|
+
|
|
67
108
|
---
|
|
68
109
|
|
|
69
110
|
### Basic Usage
|
|
@@ -275,7 +316,7 @@ This library uses **official Android APIs** to directly query the system's navig
|
|
|
275
316
|
With Android 15 enforcing edge-to-edge display for apps targeting API 35 and Google mandating this for Play Store updates starting August 31, 2025, proper navigation detection is now **essential**:
|
|
276
317
|
|
|
277
318
|
- **Edge-to-edge enforcement** - Android 16 will remove the opt-out entirely
|
|
278
|
-
- **Expo SDK
|
|
319
|
+
- **Expo SDK 52+** - New projects use edge-to-edge by default
|
|
279
320
|
- **React Native 0.79+** - Built-in support for 16KB page size and edge-to-edge
|
|
280
321
|
- **Safe area management** - Critical for preventing content overlap with system bars
|
|
281
322
|
|
|
@@ -307,6 +348,7 @@ const isGesture = await isGestureNavigation(); // 🎯 Always accurate
|
|
|
307
348
|
| -------- | ------------ | ------------------------------------------------------------ |
|
|
308
349
|
| Android | ✅ Full | Detects all navigation modes and navigation bar height via native Android APIs |
|
|
309
350
|
| iOS | ✅ Compatible | Always returns `gesture` and `navigationBarHeight: 0` (iOS uses gesture navigation) |
|
|
351
|
+
| Expo | ✅ Full | Supported in managed workflow with SDK 52+ |
|
|
310
352
|
|
|
311
353
|
### Android Compatibility
|
|
312
354
|
|
|
@@ -352,6 +394,12 @@ The library uses multiple detection methods for maximum accuracy:
|
|
|
352
394
|
- This is normal on devices without navigation bars (some tablets)
|
|
353
395
|
- On older Android versions, fallback detection may not work on all devices
|
|
354
396
|
|
|
397
|
+
**Expo: "Package does not contain a valid config plugin"**
|
|
398
|
+
|
|
399
|
+
- Ensure you've installed the latest version of the library
|
|
400
|
+
- Try clearing your cache: `npx expo start --clear`
|
|
401
|
+
- Make sure the plugin is added to your `app.json`
|
|
402
|
+
|
|
355
403
|
## 🤝 Contributing
|
|
356
404
|
|
|
357
405
|
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
|
package/package.json
CHANGED