Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions packages/sdk/react-native/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,19 @@ For more information, see the [complete reference guide for this SDK](https://do

## Known Android identify issue

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).
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.

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

- If you are using Expo, you'll need to do a native build in release `expo run:android --variant release`.
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.

- 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.
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.

- 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.
Expo also includes network debugging, which interfered with streaming responses before the above patch.

- If you are not using Expo, go to the `android` folder and manually find and remove all references to flipper.
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.

If older versions of expo and RN are used, then a release build configuration can be used to work around this issue.

## Install

Expand Down
9 changes: 4 additions & 5 deletions packages/sdk/react-native/example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@ MOBILE_KEY=abcdef12456
4. Run the app:

```shell
# Note for android, there's an issue with Flipper interfering with streaming connections
# so please run the release build. There's no such issues with ios.

# ios
yarn && yarn ios-go
yarn && yarn ios

# android
yarn && yarn android-release
yarn && yarn android

# Note: If you downgrade the React Native or Expo versions used by this example the android build may not work in debug.
```

## Running Detox e2e tests
Expand Down
5 changes: 2 additions & 3 deletions packages/sdk/react-native/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@
"dependencies": {
"@launchdarkly/react-native-client-sdk": "workspace:^",
"@react-native-async-storage/async-storage": "^1.21.0",
"expo": "~50.0.6",
"expo-splash-screen": "~0.26.4",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This splash screen made the build gradle invalid and we do not need it.

"expo": "51.0.21",
"expo-status-bar": "~1.11.1",
"react": "18.2.0",
"react-native": "0.73.4",
"react-native": "0.74.3",
"react-native-dotenv": "^3.4.9"
},
"devDependencies": {
Expand Down