firebase-cpp-sdk icon indicating copy to clipboard operation
firebase-cpp-sdk copied to clipboard

Dynamic Links C++ SDK on iOS (probably also Android) - Ignored if no internet

Open ForestRingGames opened this issue 7 years ago • 7 comments

Hello Firebase-Team,

It seems like that when clicking on a Dynamic Link while not having a (stable) internet connection, the link just gets completely ignored and also does not come back later when the connection is stable again. Can we do something to make Firebase remember the dynamic links for later?

ForestRingGames avatar Jan 28 '18 18:01 ForestRingGames

@a-maurice I hope it's okay if I tag you here ;) Just wanted to ask again if the behavior that I described is normal / expected or if it might be changed in the future?

ForestRingGames avatar Mar 06 '18 13:03 ForestRingGames

Ah, sorry for not getting back to you on this. We're a bit unclear on what the problem you are seeing is, can you lay out the repro steps, what happens, and what you are expecting to happen? Thanks!

a-maurice avatar Mar 06 '18 18:03 a-maurice

@a-maurice Okay sure, no worries:

  1. Cut your device from internet (flight mode basically)
  2. Tap on a dynamic link to open your app with it
  3. The dynamic link received callback is not called at all
  4. Even when the internet connection comes back, the dynamic link callback is also not called (so it just gets completely swallowed and is gone)

I'd expect to have the option to also receive the dynamic link when the internet connection is offline, or to receive it once the device goes online again. Maybe on the next startup and/or on the next time putting the app into foreground. One would have to know that the link is "old" and just comes now since it couldn't be processed without internet previously. Then the developer can decide if they still want to process it or not.

We created a referral system in our game Tower Duel with Dynamic Links. We'd want people that install the app and open it, then lose internet connection - still be able to get their referral rewards (and the person who referred them too of course).

ForestRingGames avatar Mar 06 '18 22:03 ForestRingGames

Gotcha, thanks for the description, that clarified things. I ran it past the Dynamic Links developers, and unfortunately it seems that if a dynamic link is clicked offline, it just won't work, since it can't set up the necessary hooks.

If they do have internet access when they click the link though, it should preserve that information for when the app is opened. For example, I tried:

  1. Uninstalling the app.
  2. Clicking dynamic link.
  3. Airplane mode.
  4. Installing the app. And then, when first running the app, in airplane mode, I still received the Dynamic Link.

I believe your use case should generally be fine, since that is one of the main use cases of dynamic links, as a referral system. If you haven't seen it, there is a page describing how to do user referrals with it here: https://firebase.google.com/docs/dynamic-links/use-cases/rewarded-referral. While the code samples are for iOS or Android, the C++ library has parity with them, so all the same logic should apply.

a-maurice avatar Mar 09 '18 19:03 a-maurice

That said, we do think we can do some better handling of this case, providing at least an error in offline mode, or trying again when online is available, as you had suggested. Thanks for pointing out this issue, since it is an important use case that we are definitely lacking good support for.

a-maurice avatar Mar 09 '18 20:03 a-maurice

@a-maurice Thank you for the detailed info and the testing! Our game Tower Duel has indeed already a referral system in place and it works very well with Dynamic Links!

Okay, so as far as I understand the link only gets lost if somebody already has the app installed, then clicks the link and has no internet connection (for a second or so). But the app will open nonetheless by clicking the link - just that no callbacks will be triggered.

But if the user clicks the link, then gets to the Play Store / App Store, downloads the app, opens the app for the first time and has no internet connection, the callback will be triggered? (since the link was already opened when opening the store?)

ForestRingGames avatar Mar 10 '18 14:03 ForestRingGames

This issue does not seem to follow the issue template. Make sure you provide all the required information.

google-oss-bot avatar Sep 02 '20 23:09 google-oss-bot