Closed m-berenson closed 1 year ago
Hi @m-berenson ,
We've filed this internally to take a look at and will update this issue with progress.
Hello, I can confirm this issue after upgrading from 5.x to 6.x. In a usual react-navigation setup, this also blocks rendering of the first route since the promise for getting the initial route is pending indefinitely because the Braze callback is not called.
Hi @m-berenson @Minishlink,
We have just released React Native SDK version 7.0.0 which fixes this issue.
Thanks!
Which Platforms?
Android
Which React Native Version?
0.71.7
Which @braze/react-native-sdk SDK version?
6.0.1
Repro Rate
100%
Steps To Reproduce
@braze/react-native-sdk
to 6.0.1Expected Behavior
Expected
Braze.getInitialUrl()
callback return null value on AndroidActual Incorrect Behavior
Braze.getInitialUrl()
callback does not return a anything on AndroidVerbose Logs
No response
Additional Information
I was using Braze.getInitialURL() for both iOS & Android platforms. We use it with promises:
new Promise(resolve => Braze.getInitialURL(resolve))
.That works well in v5.x.x but when upgrading to
6.0.1
when running on Android it got stuck on the first screen of the app. On iOS worked well.Digging deeper into the code I found that the Android bridge for
6.0.0
has an empty implementation forgetInitialUrl
. (never use the callback) https://github.com/braze-inc/braze-react-native-sdk/blob/21aa2517539eaab86ddae1522377fa32118e748a/android/src/oldarch/com/braze/reactbridge/BrazeReactBridge.kt#L12-L14And in the JS side, it checks for
this.bridge.getInitialUrl
to be defined, otherwise it call thecallback
function withnull
. Since starting 6.0.0getInitialUrl
is defined but does not have any implementation, it seems the callback argument is never called. https://github.com/braze-inc/braze-react-native-sdk/blob/21aa2517539eaab86ddae1522377fa32118e748a/src/braze.js#L48-L62In the React Native layer I was waiting to that callback but the promise never resolves a value. I think it is due the callback on Android bridge is defined but never uses the callback.
Fixed the issue checking if Android or iOS in order to call
Braze.getInitialUrl()
, but it took me a bit to understand the root problem 😅 .