[ANDROID] Linking.getInitialURL() returns null after exiting the app with back button and using deep linking again (only in production!) #15961
Labels
Ran Commands
One of our bots successfully processed a command.
Stale
There has been a lack of activity on this issue and it may be closed soon.
Is this a bug report?
Yes.
Environment
react-native -v
: 0.46.4node -v
: 8.4.0npm -v
: 5.3.0yarn --version
: 0.27.5Steps to Reproduce
Configure your app to receive deep linking links as explained here: https://facebook.github.io/react-native/docs/linking.html.
My native code looks like:
I also set the Android Activity to
singleTask
.On the JS code:
Expected Behavior
Actual Behavior
Development
Production
From Logcat:
As you can see Intent has data but the
console.log
insidegetInitialURL
showsnull
as url.It looks like an issue which the fact that even that I kill the activity with back button, JS bundle is not destroyed till it passes some time. However, I don't understand why the behavior is different in development than in production. The correct behavior is the development one though.
Some debugging
react-native/ReactAndroid/src/main/java/com/facebook/react/modules/intent/IntentModule.java
Line 50 in 1e8f3b1
currentActivity
is nullgetInitialURL
with a 10mssetTimeout
actually makes it workRace condition somewhere? Is it possible than in this case
componentDidMount
it's called before the actual activity gets created?Reproducible Demo
Can't do it in Expo. I'll try to write something I can share.
The text was updated successfully, but these errors were encountered: