firebase / firebase-android-sdk

Firebase Android SDK
https://firebase.google.com
Apache License 2.0
2.25k stars 570 forks source link

157239028: Firebase Dynamiclink not open my MAIN Activity and not receive newest link data #982

Closed WadeXHong closed 1 year ago

WadeXHong commented 4 years ago

[REQUIRED] Step 2: Describe your environment

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

I'm not a native speaker in English, sorry for my bad grammar 😓

I found that dynamic links might not open my app through the activity with action.MAIN tag when I click the link to my app after first time(which is completely fine). In this situation, neither the intent from onNewIntent with launchMode=singleTask nor normal getIntent with launchMode=standard returns the newest data from firebase but the previous one. However, if I clear the app from history before open it without dynamiclink, I can still get the latest missing data, which might be the same cause by issue #357

For example, if I have two dynamic links: link_a => https://example.page.link/url1 link_b => https://example.page.link/url2

I press link_a in social media -> open my app -> receive data inside link_a -> get back to social media and press link_b or link_a again -> open my app (not restart my MAIN activity) -> still receive data inside link_a until completely close the app -> completely close the app and launch app by icon (I should not get any link data) -> receive link_b data which I should get previous

When dynamic links run into not launch my app from MAIN activity for the first time, it won't restart MAIN activity even if I use adb command or other ways to send intent until clear from history.

google-oss-bot commented 4 years ago

I found a few problems with this issue:

aguatno commented 4 years ago

Hi @WadeXHong I've never seen this before, could you provide a minimal runnable repro of your app so I can also test this one locally? Thanks

WadeXHong commented 4 years ago

Hi @aguatno, I've write a very tiny repo and create some links. Here's the repo and thanks !

WadeXHong commented 4 years ago

I'v tried put my dynamiclinks in Facebook Messenger, Facebook, Slack, Telegram and Line apps, but only Facebook Messenger and Line have this issue, and I found that they have intent flag different from others. ( Facebook has another issue, it always bring me to Google Play...)

It looks the intent flags be sent to AppInviteAcceptInvitationActivity directly impact the way how system launch my app later, and the apps work fine with dynamiclinks are using Chrome Custom Tabs to browse web.

Here's the logcat:

Apps with issue

Apps work fine

aguatno commented 4 years ago

Hi @WadeXHong thanks for the info. I'm a bit confused with this step:

Doing step 2 (leave app) again and click FDL_Reddit -> you will see app is open not through MainActivity and still show https://www.google.com on screen

I didn't get the google.com, but reddit.com on screen. Here's a screencast of my test.

WadeXHong commented 4 years ago

Hi @aguatno, thanks for your replying. As I mentioned in the last commented, this happened only in some apps (FB Messenger, LINE, etc...) with in-app normal webview. I take three screencasts of different scenarios.

Failed case from FB Messenger : The test app is NOT in history and open by dynamic links in FB Messenger app. The first open link (reddit) will have this issue.

Success case from FB Messenger : The test app first open not by dynamic links, and then everything works fine.

Success case from Telegram : The flow is same as the first scenario, just change FB Messenger to Telegram, everthing works fine too.

Thanks again.

WadeXHong commented 4 years ago

Hi, is there anything update?

WadeXHong commented 4 years ago

Hi @aguatno, I'm looking forward to your response !! 🙏

aguatno commented 4 years ago

@WadeXHong sorry for the delay. I was able to reproduce the issue now, I'll consult the issue to the team. I'll get back to you once I got an update.

aguatno commented 4 years ago

I filed an issue internally using this bug#147086947. I'll let you know once I heard feedback from them.

argzdev commented 1 year ago

Just bumping this thread. Upon checking the internal bug link, it seems that the issue is specific to Facebook and Line. After testing, it's been verified that there's no issue with FDL itself. That said, I'll close this issue now.