Reputation: 842
I am building a companion app for a webpage. I am supposed to open links on that page with the app. So i added an intent filter to my activity, like so:
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="http" />
<data android:host="www.mywebpage.com" />
<data android:pathPrefix="/" />
</intent-filter>
When i search for my site on Google and click a result, this works. The "open with" sheet is presented and i can choose my app to open the link. When i enter the URL to my site in the address bar, the sheet is not presented. I can then browse the site in the browser (i am using Chrome), and i can click every link without every being asked whether i want to open the link with the app.
Is there any way to always present the "open with" sheet when clicking a link that can be opened with my app? I realise that the user probably wants to browse the site in the browser, when he explicitly enters the URL in the address bar, but opening the share sheet is what i am supposed to implement.
Upvotes: 0
Views: 274
Reputation: 366
It seems that Google made some changes in how Chrome process the URLs. Their policy now is "If a user enters a URL into the address bar of the system, then the intention of the user is to visit the page in question. We don’t believe that the user intended to go to the app. Ergo, redirecting the user to the app is a poor user experience."
You can find more information about this subject in here - https://paul.kinlan.me/deep-app-linking-on-android-and-chrome/
Upvotes: 1