4

I launch ChromeCustomTabs from my app. The page in chorme custom tabs show a button. On click of that button a deep link is triggered, something like this myapp://show/screen?id=123. My corresponding intent-filter is like this:

            <intent-filter>
                <action android:name="android.intent.action.VIEW"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <category android:name="android.intent.category.BROWSABLE"/>

                <data android:scheme="myapp"/>
                <data android:host="show"
                    android:path="/screen"/>
            </intent-filter>

Problem: When user taps on that button, it launches my app only if the version of chrome is recent or latest 74.. Whereas it doesn't trigger my app on older versions of chrome browser e.g. on 65..

LoveForDroid
  • 1,072
  • 12
  • 25
  • 1
    I have found the "data" part of intent filters to be a bit buggy and sometimes they don't function "as advertised". You could try removing the `path` and setting a `pathPattern="/.*"` instead. Or use the "intent syntax" to launch the intent from a HTML anchor. For example, in your case it'll be `Click me` – Leo Aug 06 '19 at 01:41
  • @Leo unfortunately both of the options didn't work for me. Problem is whatever intent-filter setting, deep-link intent is, they work on higher version of chrome browser but not on lower version. – LoveForDroid Aug 06 '19 at 04:24
  • If you open regular Chrome instead for Chrome Custom Tabs, does the deeplink work? – andreban Aug 07 '19 at 07:17
  • @andreban yes it does. – LoveForDroid Aug 07 '19 at 18:33

1 Answers1

7

It turns out to be a well known issue. I was getting a Navigation is Blocked console message when I connect my emulators dev tools in browser. Google Chrome won't let a deeplink to open an app, if it is triggered by a javascript. It has to be a user initiated action. In my case after the user clicks on button, there were series of things done behind ajax call, before deeplink was triggered.

As a workaround, once the button is clicked and web is done with all the ajax calls, it redirects to new intermediate screen. This screen was created with a button for user to click(Continue). On click of this button, deeplink successfully redirected to app.

LoveForDroid
  • 1,072
  • 12
  • 25
  • 1
    Hi @LoveForDroid. I'm facing this issue, Gmail opens my links with Chrome Tabs and the final page with the user action button "Take me back to the app" doesn't trigger my intent-filter. Can you update your response with your code sample showing how you setup your intent filter and your ? Thanks. – GuilhE Nov 27 '19 at 17:05