From 26ebaf96301ed17673e69a044237dec2af7ba6c9 Mon Sep 17 00:00:00 2001 From: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com> Date: Fri, 19 Jul 2024 09:39:33 -0700 Subject: [PATCH 1/5] feat: Update expo and RN version used in example. fix: Remove splash screen plugin causing an invalid build.gradle. --- packages/sdk/react-native/example/package.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/sdk/react-native/example/package.json b/packages/sdk/react-native/example/package.json index d9f4a7dfe2..b11df52ffd 100644 --- a/packages/sdk/react-native/example/package.json +++ b/packages/sdk/react-native/example/package.json @@ -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", + "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": { From 445b63ba1d5d993da8a06403206203ca4a587f72 Mon Sep 17 00:00:00 2001 From: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com> Date: Fri, 19 Jul 2024 09:48:28 -0700 Subject: [PATCH 2/5] chore: Update RN readme with identify information. --- packages/sdk/react-native/README.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/sdk/react-native/README.md b/packages/sdk/react-native/README.md index 76244ec3b9..e673a3290f 100644 --- a/packages/sdk/react-native/README.md +++ b/packages/sdk/react-native/README.md @@ -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 interferes with streaming responses as well. -- 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. + +If older versions of expo and RN are used, then a release build configuration can be used to work around this issue. ## Install From 834378a40f8c64af74180b3be27627f4c18530f3 Mon Sep 17 00:00:00 2001 From: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com> Date: Fri, 19 Jul 2024 09:49:59 -0700 Subject: [PATCH 3/5] chore: Update example readme about identify issue. --- packages/sdk/react-native/example/README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/sdk/react-native/example/README.md b/packages/sdk/react-native/example/README.md index 0cd23e7018..ba99d12f42 100644 --- a/packages/sdk/react-native/example/README.md +++ b/packages/sdk/react-native/example/README.md @@ -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 From 76538cd783bc2ddccbe03722874f7dca351ba33e Mon Sep 17 00:00:00 2001 From: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com> Date: Fri, 19 Jul 2024 09:51:37 -0700 Subject: [PATCH 4/5] more readme updates. --- packages/sdk/react-native/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/sdk/react-native/README.md b/packages/sdk/react-native/README.md index e673a3290f..b61857fb6e 100644 --- a/packages/sdk/react-native/README.md +++ b/packages/sdk/react-native/README.md @@ -25,7 +25,7 @@ If you are using expo after that release, as well as a React Native version with 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. -Expo also includes network debugging, which interferes with streaming responses as well. +Expo also includes network debugging, which interfered with streaming responses before the above patch. When running with `expo start`, which will run with Expo Go by default, the Expo Go binary includes the native expo code. From c6b199e52b67aa0cef88322a6f22d20e95a03f94 Mon Sep 17 00:00:00 2001 From: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com> Date: Fri, 19 Jul 2024 09:52:36 -0700 Subject: [PATCH 5/5] Refine expo go statements. --- packages/sdk/react-native/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/sdk/react-native/README.md b/packages/sdk/react-native/README.md index b61857fb6e..606a7e105a 100644 --- a/packages/sdk/react-native/README.md +++ b/packages/sdk/react-native/README.md @@ -27,7 +27,7 @@ The SDK uses SSE streaming to get flag data and in React Native versions with Fl Expo also includes network debugging, which interfered with streaming responses before the above patch. -When running with `expo start`, which will run with Expo Go by default, the Expo Go binary includes the native expo code. +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.