Amith Ramachandran
Amith Ramachandran

Reputation: 259

Deep link to app not working while opened in gmail built in browser

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 :)

Upvotes: 12

Views: 7755

Answers (1)

Loz
Loz

Reputation: 141

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.

Upvotes: 1

Related Questions