17

I am trying to do deep linking such that when someone opens a link from mobile browser, it either opens the app, if it is installed or opens the play store link to download the app.

Here is my URI :

intent://scan/#Intent;scheme=com.example.android;package=com.example.android;end

When I type this in Mozilla Firefox app on Android, it opens my app if it is installed or opens the play store link if it not installed. But, when I type the same thing in Chrome, instead of opening app or play store, it just does a google search. What is wrong with my solution and how do I make it work?

Amit Tiwari
  • 3,684
  • 6
  • 33
  • 75
  • 1
    Just to clarify, are you _typing_ the URL, or _pasting_ it into the address box? – Alex Bauer May 06 '16 at 13:48
  • if you paste the url in browser will not direct to app, above intent works only if you directs url (user click link and that link open ) to browser then only browser open app which you are trying to open – Mohd Qasim Sep 22 '20 at 11:14

1 Answers1

27

This is a known wontfix bug in Chrome 40+ (see the Chromium project ticket here for the full story).

Essentially, the Chrome team feels that if a user actually types something into the address bar, no redirect should ever happen. As you've discovered, this is counter to behavior in all other browsers.

Fortunately it's unlikely a user would actually type an intent:// URI by hand. If you wrap the URL inside a link on a webpage, or offer a link to another page and then issue a redirect of some kind (so that you can detect the user agent and not show a 'broken' intent:// link to users on other browsers), it should work correctly.

If you don't want to handle all these edge cases, you could also try a free service like Branch.io (full disclosure: I'm on the team).

Alex Bauer
  • 13,147
  • 1
  • 27
  • 44
  • 1
    will Branch.io work for redirects to deep links too? I have a problem with a deep link to the Android Pay app. If I type the link in the address bar I'm moved to the app correctly but if I use a redirect, then google chrome on my android device send me the the Play Store website. This is happening only on Google Chrome Browser for Android. – DMEM Feb 10 '17 at 00:11
  • @DMEM I think it would be better if you can open a new question with a few more details. Throw the `deep-linking` tag on there and I'll see it – Alex Bauer Feb 14 '17 at 00:27
  • Thanks @Alex Bauer . I contacted Google Support and their engineering team is looking into this issue so for now I will wait. I will leave an update here when I hear back from them. – DMEM Feb 14 '17 at 21:03
  • @DMEM ever heard something about this ? – LukeFilewalker Mar 18 '19 at 19:57
  • @LukeFilewalker Google fixed my issue by simply replacing the deeplink URL I was using. The correct URL for the Google Pay app should be: https://www.android.com/payapp/savetoandroidpay/ – DMEM Mar 23 '19 at 00:10
  • well my co-worker says if google team believer in ghost – Emad Fani Dec 15 '19 at 10:54