5

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..

4
  • 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 <a href="intent://show/screen?id=123#Intent;scheme=myapp;package=your.app.package.name;end">Click me</a> Commented Aug 6, 2019 at 1: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. Commented Aug 6, 2019 at 4:24
  • If you open regular Chrome instead for Chrome Custom Tabs, does the deeplink work? Commented Aug 7, 2019 at 7:17
  • @andreban yes it does. Commented Aug 7, 2019 at 18:33

1 Answer 1

8

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.

Sign up to request clarification or add additional context in comments.

1 Comment

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 <a href>? Thanks.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.