8

Facing an issue with opening a deep link into my app when the web page containing the deep link is opened from the Gmail built in browser. Deep link works fine if I open the web page containing the deep link in Chrome browser.

My workflow is as follows. I get an email with a link, when I tap on the link, it opens a web page which contains the deep link am interested in. By default the link is opened in the built in gmail browser when the user taps on the link in mail body and it then open a web page containing the deep link to my app. When the user tap on the deep link, they get a 'Page not found'. However all this works fine if the user opened the link in the mail body in Chrome or any other browser.

Below is the link that should be opened when a user tap on the deep link in web page

http://127.0.0.1/abc/def com.my.app

I can fire below command from shell and it works fine adb shell am start -W -a android.intent.action.VIEW -d http://127.0.0.1/abc/def com.my.app

Also if I just put http://127.0.0.1/abc/def com.my.app in an email and open it from Gmail (without going to the gmail browser, it works fine)

Below is my intent filter setup

          <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:host="127.0.0.1"/>
               <data android:scheme="http"/>
               <data android:pathPrefix="/abc/def"/>
           </intent-filter>

I have gone through similar issues in stack and could't find a working solution. Thanks in advance for your help :)

  • what happens if u add another scheme. in addition to http, try myapp. then inside JS, do window.location = 'myapp://127.0.0.1/....'; – letsCode Jan 23 '19 at 20:54
  • I didn't try a custom schema. I don't own the web page that displays the deep link and have to go through another team to modify anything in there. Also this post from Dianne Hackborn states its a wrong practice to use a custom schema https://stackoverflow.com/a/3472228/5326805 – Amith Ramachandran Jan 23 '19 at 21:25
  • You can definitely do whatever you would like. However to follow the advice or opinion from someone from 2010 is something that I wouldn't do. If anything, I would follow the instructions from Google themselves. https://developer.android.com/training/app-links/deep-linking – letsCode Jan 23 '19 at 21:29
  • And using that person's logic, you don't own HTTP either so why use that? you also said that you don't own the website so I find it strange that you would even want to do a deep link – letsCode Jan 23 '19 at 21:30
  • 1
    I should have made it more clear, I meant I don't maintain the website. The web page is from the same company I work for. Also there is an iOS team that uses the same deep link. So changing the schema is not the best option for me. Also the deep link works when the page is opened in a browser or from an email body or the adb command I mentioned. – Amith Ramachandran Jan 24 '19 at 22:38
  • I have the same issue here - any idea what the problem is/was? – MDalt Jan 09 '20 at 19:59

1 Answers1

0

After setting up app links for our app and verifying that deeplinks were working when clicking a link from outlook, I was also in a position where deeplinks were not working when clicked from the gmail app (they only seemed to be working in outlook).

The solution was to navigate to Apps -> Default Apps -> Opening Links -> [YOUR APP] -> Supported Web Addresses -> Click the toggle next to the deeplink URI. App then began to open when clicking on our configured deeplink URL in gmail and everywhere else.

Loz
  • 118
  • 11