react-native-code-push icon indicating copy to clipboard operation
react-native-code-push copied to clipboard

Firebase Dynamic Link not triggered when Code Push reinitializes the app

Open afilp opened this issue 8 years ago • 19 comments

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",

afilp avatar Feb 05 '18 17:02 afilp

+1

linzziy avatar Feb 06 '18 05:02 linzziy

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 avatar Feb 06 '18 17:02 itoys

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

afilp avatar Feb 07 '18 19:02 afilp

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 avatar Mar 22 '18 19:03 Zakeelm

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

Salakar avatar Mar 23 '18 19:03 Salakar

Any update on this?

jonstuebe avatar Mar 06 '20 10:03 jonstuebe

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?

jedashford avatar Apr 23 '20 01:04 jedashford

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!

afilp avatar Jun 29 '20 14:06 afilp

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 avatar Jun 29 '20 15:06 jedashford

@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?

afilp avatar Jun 29 '20 15:06 afilp

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.

jedashford avatar Jun 29 '20 15:06 jedashford

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.

jedashford avatar Jun 30 '20 01:06 jedashford

@alexandergoncharov I'd suggest this be closed. The problem is with an older library of react native firebase and not with codepush.

jedashford avatar Jun 30 '20 01:06 jedashford

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.

papadi avatar Sep 07 '20 07:09 papadi

"@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

omonk avatar Oct 13 '21 10:10 omonk

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.

ghost avatar Dec 13 '21 17:12 ghost

We are experiencing this problem too, and would a appreciate a fix or a recommended work around.

PhilipHow avatar Dec 21 '21 01:12 PhilipHow

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.

ghost avatar Feb 19 '22 05:02 ghost

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.

ghost avatar Mar 06 '22 06:03 ghost