Closed WadeXHong closed 1 year ago
I found a few problems with this issue:
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
Hi @aguatno, I've write a very tiny repo and create some links. Here's the repo and thanks !
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:
Facebook Messanger
START u0 {dat=https://bardxhongfdltest.page.link/... flg=0x20000000 cmp=com.facebook.orca/com.facebook.browser.lite.BrowserLiteActivity (has extras)} START u0 {act=com.google.firebase.dynamiclinks.VIEW_DYNAMIC_LINK cat=[android.intent.category.BROWSABLE] dat=https://bardxhongfdltest.page.link/... flg=0x10000000 pkg=com.google.android.gms cmp=com.google.android.gms/.appinvite.AppInviteAcceptInvitationActivity (has extras)} from uid 10222 START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] dat=https://www.google.com/... flg=0x10000000 pkg=com.bardxhong.fdltest cmp=com.bardxhong.fdltest/.MainActivity (has extras)} from uid 10146
Line
START u0 {dat=https://bardxhongfdltest.page.link/... flg=0x10000000 cmp=jp.naver.line.android/com.linecorp.browser.OpenUriActivity (has extras)} from uid 10214 START u0 {dat=https://bardxhongfdltest.page.link/... cmp=jp.naver.line.android/.activity.iab.InAppBrowserActivity (has extras)} from uid 10214 START u0 {act=com.google.firebase.dynamiclinks.VIEW_DYNAMIC_LINK cat=[android.intent.category.BROWSABLE] dat=https://bardxhongfdltest.page.link/... pkg=com.google.android.gms cmp=com.google.android.gms/.appinvite.AppInviteAcceptInvitationActivity (has extras)} from uid 10214 START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] dat=https://www.google.com/... flg=0x10000000 pkg=com.bardxhong.fdltest cmp=com.bardxhong.fdltest/.MainActivity (has extras)} from uid 10146
Telegram
START u0 {act=android.intent.action.VIEW dat=https://bardxhongfdltest.page.link/... flg=0x10000000 pkg=com.android.chrome cmp=com.android.chrome/com.google.android.apps.chrome.IntentDispatcher (has extras)} from uid 10212 START u0 {act=android.intent.action.VIEW dat=https://bardxhongfdltest.page.link/... flg=0x18080000 pkg=com.android.chrome cmp=com.android.chrome/org.chromium.chrome.browser.customtabs.CustomTabActivity (has extras)} from uid 10195 START u0 {act=com.google.firebase.dynamiclinks.VIEW_DYNAMIC_LINK cat=[android.intent.category.BROWSABLE] dat=https://bardxhongfdltest.page.link/... flg=0x14000000 pkg=com.google.android.gms cmp=com.google.android.gms/.appinvite.AppInviteAcceptInvitationActivity (has extras)} from uid 10195 START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] dat=https://www.google.com/... flg=0x14000000 pkg=com.bardxhong.fdltest cmp=com.bardxhong.fdltest/.MainActivity (has extras)} from uid 10146
Slack
START u0 {act=android.intent.action.VIEW dat=https://bardxhongfdltest.page.link/... cmp=com.android.chrome/com.google.android.apps.chrome.IntentDispatcher (has extras)} from uid 10211 START u0 {act=android.intent.action.VIEW dat=https://bardxhongfdltest.page.link/... flg=0x800000 cmp=com.android.chrome/org.chromium.chrome.browser.customtabs.CustomTabActivity (has extras)} from uid 10195 START u0 {act=com.google.firebase.dynamiclinks.VIEW_DYNAMIC_LINK cat=[android.intent.category.BROWSABLE] dat=https://bardxhongfdltest.page.link/... flg=0x14000000 pkg=com.google.android.gms cmp=com.google.android.gms/.appinvite.AppInviteAcceptInvitationActivity (has extras)} from uid 10195 START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] dat=https://www.google.com/... flg=0x14000000 pkg=com.bardxhong.fdltest cmp=com.bardxhong.fdltest/.MainActivity (has extras)} from uid 10146
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.
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.
Hi, is there anything update?
Hi @aguatno, I'm looking forward to your response !! 🙏
@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.
I filed an issue internally using this bug#147086947. I'll let you know once I heard feedback from them.
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.
[REQUIRED] Step 2: Describe your environment
[REQUIRED] Step 3: Describe the problem
Steps to reproduce:
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
withlaunchMode=singleTask
nor normalgetIntent
withlaunchMode=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 #357For 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.