Skip to content

Commit b8384c4

Browse files
authored
feat: Update expo and RN version used in example. (#520)
After this PR the example React Native app will work correctly with Android. Most of the PR is documentation.
1 parent 52055ba commit b8384c4

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

packages/sdk/react-native/README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,19 @@ For more information, see the [complete reference guide for this SDK](https://do
1717

1818
## Known Android identify issue
1919

20-
On Android, Flipper interferes with the SDK's streaming connections. As a result the `identify` call never resolves. The long term solution is the removal of Flipper from react-native. The Facebook team are [working on this](https://reactnative.dev/blog/2023/12/06/0.73-debugging-improvements-stable-symlinks#flipper--react-native-integration).
20+
With Expo versions less than `51.0.21` and React Native versions less than `0.74.3`, the identify operation will not be complete in a debug configuration. If using Expo Go, you must ensure you have version `2.31.2` or greater.
2121

22-
In the meantime, we recommend one of these workarounds:
22+
This is the expo PR that resolved this issue: https://github.com/expo/expo/pull/30062
2323

24-
- If you are using Expo, you'll need to do a native build in release `expo run:android --variant release`.
24+
If you are using expo after that release, as well as a React Native version without flipper, then the SDK should be able to identify in debug mode. We specifically tried Expo version `51.0.21 ` with React Native `0.74.3`, but some other patch version combinations may work.
2525

26-
- If you are using Expo and want to debug and hot reload, you'll need to do a native build in debug `expo run:android --variant debug` and then go to the `android` folder and manually find and remove all references to flipper. This is a [reported issue](https://github.com/facebook/flipper/issues/1326#issuecomment-652946496) in the Flipper repo.
26+
The SDK uses SSE streaming to get flag data and in React Native versions with Flipper, the network capture interferes with HTTP requests that are streamed through HTTP.
2727

28-
- If you are using the expo-go app on Android, unfortunately there is no known easy way to disable Flipper in Expo Go. Please use one of two previous native build options.
28+
Expo also includes network debugging, which interfered with streaming responses before the above patch.
2929

30-
- If you are not using Expo, go to the `android` folder and manually find and remove all references to flipper.
30+
When running with `expo start`, which will run with Expo Go by default, the Expo Go binary includes the native expo code. This is why an Expo Go version which contains the relevant patch must be used.
31+
32+
If older versions of expo and RN are used, then a release build configuration can be used to work around this issue.
3133

3234
## Install
3335

packages/sdk/react-native/example/README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,13 @@ MOBILE_KEY=abcdef12456
1919
4. Run the app:
2020

2121
```shell
22-
# Note for android, there's an issue with Flipper interfering with streaming connections
23-
# so please run the release build. There's no such issues with ios.
24-
2522
# ios
26-
yarn && yarn ios-go
23+
yarn && yarn ios
2724

2825
# android
29-
yarn && yarn android-release
26+
yarn && yarn android
27+
28+
# Note: If you downgrade the React Native or Expo versions used by this example the android build may not work in debug.
3029
```
3130

3231
## Running Detox e2e tests

packages/sdk/react-native/example/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,10 @@
2323
"dependencies": {
2424
"@launchdarkly/react-native-client-sdk": "workspace:^",
2525
"@react-native-async-storage/async-storage": "^1.21.0",
26-
"expo": "~50.0.6",
27-
"expo-splash-screen": "~0.26.4",
26+
"expo": "51.0.21",
2827
"expo-status-bar": "~1.11.1",
2928
"react": "18.2.0",
30-
"react-native": "0.73.4",
29+
"react-native": "0.74.3",
3130
"react-native-dotenv": "^3.4.9"
3231
},
3332
"devDependencies": {

0 commit comments

Comments
 (0)