Firebase Dynamic Link not triggered when Code Push reinitializes the app
Steps to Reproduce
Open the app through a Firebase Dynamic Link
Expected Behavior
Firebase Dynamic Link to be remembered and acted upon (navigate to an internal route) after code-push reinitiallizes the app.
Actual Behavior
What actually happens?
Code push reinitializes the app and Firebase Dynamic Link is lost forever (so nothing happens, no navigation to an internal route takes place).
Environment
"react": "16.2.0",
"react-native": "0.52.0",
"react-native-code-push": "^5.2.1",
"react-native-firebase": "^3.2.2",
+1
Hi @afilp
Just for clarification
If you Reload JS from RN Dev menu it works as you expect? I'm not sure if this possible in RN
@iTOYS Since this is a reload (from RN DEV menu) the firebase dynamic links info is lost. Obviously the same happens with Code-Push but I was wondering if you have a workaround or a code change that could store the links and reuse them on next load (after code-push). I assume that this may need some collaboration between you (code-push) and the authors of "react-native-firebase"? Thanks for any info.
This is a very interesting feature idea. I can definitely see the use. I'm going to leave this open for now to see if this is something other users are interested in as well. If enough users are interested, we will further investigate this!
@Zakeelm if you need anything from us (Invertase/RNFirebase) or if we can assist on this let us know 👍
For reference this is where we store the initial link the app was opened with: https://github.com/invertase/react-native-firebase/blob/master/android/src/main/java/io/invertase/firebase/links/RNFirebaseLinks.java#L32
My guess is we need to move this somewhere where this can persist across reloads but not app restarts - open to suggestions. Similar on iOS as well.
Any update on this?
We have seen this work fine for Android, its just iOS that loses the dynamic link data on js bundle reload. Wouldn't the values be stored on the native side? So iOS would get the same deeplink data if the js bundle was restarted 100 times?
Hi, Is there something we can do ourselves?
This problem restricts us from giving dynamic links to our end-users (as they do not work when the app is code pushed).
Thanks a lot!
We've moved to the new version of react native firebase this week, but haven't tested if it fixes the problem.
What we did with 5.5.x was to hold codepush, store in async storage the deeplink data, if any, then resume codepush restart. Once restarted, check if there is any deeplink data in async storage, execute on it, then clear the async storage.
This has worked fine for us over the past few months.
@jedashford I am not sure if you reply as a member of the react-native-code-push team (on behalf of their implementation) or as another developer like us.
Do you mean that this trick is done inherently by react-native-code-push?
No, I'm saying we built that logic flow into our react native app. I have no affiliation with codepush, other than I use the product.
Our engineer who upgraded react native firebase to 7.x says this problem is fixed. Codepush js package reload no longer wipes the dynamic link data. Upgrading react-native-firebase libraries to > 7.x should fix any issues you have.
@alexandergoncharov I'd suggest this be closed. The problem is with an older library of react native firebase and not with codepush.
Our engineer who upgraded react native firebase to 7.x says this problem is fixed. Codepush js package reload no longer wipes the dynamic link data. Upgrading react-native-firebase libraries to > 7.x should fix any issues you have.
I'm using 7x and I do not confirm this. This is still happening.
"@react-native-firebase/app": "^9.0.0",
"@react-native-firebase/dynamic-links": "^7.5.13",
"react-native-code-push": "^7.0.1",
DynamicLinks are persisted on iOS
Does not work on Android
This issue has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs within 15 days of this comment.
We are experiencing this problem too, and would a appreciate a fix or a recommended work around.
This issue has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs within 15 days of this comment.
This issue will now be closed because it hasn't had any activity for 15 days after stale. Please feel free to open a new issue if you still have a question/issue or suggestion.