android-browser-helper icon indicating copy to clipboard operation
android-browser-helper copied to clipboard

Deep link not working when chrome custom tab is connected to service

Open mohitsvnit opened this issue 3 years ago • 8 comments

Describe the bug When we open a url for which app is present in device, that app is not opening, instead it opens in chrome custom tab when we bind cct to service. Url: https://www.amazon.in/Samsung-Galaxy-M12-Storage-Processor/dp/B08XGDN3TZ/ref=lp_27030680031_1_2

To Reproduce Steps to reproduce the behavior:

  1. Install Amazon App
  2. Replace URL in custom-tab-navigation-callback demo to above shared url
  3. Click on launch
  4. It will open in cct instead of amazon app

Expected behavior It should open in amazon app as cct does without binding to service

Did this ever used to work Yes

Smartphone (please complete the following information): Happen in all the devices.

  • Device:POCO X3 Pro
  • OS: Android 11
  • Browsers Installed Chrome
  • Browser Versions: Latest
  • android-browser-helper library version: Latest

mohitsvnit avatar Dec 01 '21 12:12 mohitsvnit

same here! exactly same device and same problem @mohitsvnit

namini40 avatar Jan 09 '22 07:01 namini40

When you say "when we open a url", do you mean "when you launch an Intent" or "when the user of a Custom Tab navigates to the url"?

PEConn avatar Jan 10 '22 09:01 PEConn

@PEConn when we launch an Intent.

mohitsvnit avatar Jan 10 '22 14:01 mohitsvnit

This is working as intended - if you've gone to the trouble of connecting to the browser and providing some sort of callback, it would make sense that you'd want the Custom Tab to be launched in that browser.

How come you're connecting to the Custom Tabs Service, but then you want to launch the Intent to the Amazon app?

You mention "Did this ever used to work: Yes" - are you sure about that? We haven't changed our logic here?

PEConn avatar Jan 11 '22 11:01 PEConn

@PEConn Did this ever used to work: Yes, no it wasn't working earlier before.

if you've gone to the trouble of connecting to the browser and providing some sort of callback, it would make sense that you'd want the Custom Tab to be launched in that browser.

We are connecting to the service to know about the callbacks so that we can track the URL loading status. But we still would want for deeplinks to work as they would without connecting to service.

mohitsvnit avatar Jan 11 '22 18:01 mohitsvnit

I'm having a similar issue, we are using the CCT to complete a purchase through a 3rd party (CashFlows) and they are redirecting the browser to our URL which is meant to pull focus back to our app (DeepLink) but it is very intermittent that is works some times and sometimes not... I cannot seem to find any consistent reasoning for it not working. I can perform the same action on different phones repeatedly and get different results on each phone each time.

projectdelta6 avatar Aug 19 '22 11:08 projectdelta6

Same for me. Currently using androidx.browser:browser:1.8.0 version but I tried almost every version.

Chrome custom tab intent is launched from fragment, and I am handling the redirection in RedirectHandlerActivity. The issue is that for some devices (in this case Google Pixel 4 & Samsung A32) it works and successfully opens my redirection activity, But there are cases in which redirection is not handled and the Chrome tab stays open (tested on Pixel 7 & Samsung A33).

P.S The domain is also trusted (by assetslinks.json) and still has an issue, another weird thing is that for some devices (tested it on 3 different pixels) it is not trusted on the first install and if I uninstall the app and reinstall it again then it appears trusted.

code example https://stackoverflow.com/questions/78458594/android-chrome-custom-tab-redirection-not-captured-for-some-devices

developer-- avatar May 15 '24 11:05 developer--