I have this intent-filter
that I want that every time user clicks a link to eeexample.com to open my app:
<intent-filter> <data android:scheme="http" /> <data android:scheme="http" android:host="eeexample.com"/> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> </intent-filter>
When user clicks eeexample.com on gmail app for example:
Which then opens a dialog which asks user if they want this link to be opened from my app or browser like this:
But I just want that when user clicks the link it opens ONLY my app without asking anything. Or in a worst case scenario to just ask to open it with my app which is Appetit not with browser. Is this possible?
So it seems this is possible to do with App Links but only for API level 23 (Android 6.0), but I need this for api level 15 (Android 4.0), any ideas?
Tap on the app. On the next page, tap Open supported links and it will show you three options- “Allow app to open supported links, Always Ask, Don't allow app” to open links. You should select 'Don't allow the app to open links' to stop it from opening every time. Restart the phone, and that's it.
Bypassing the disambiguation dialog is only possible with the Android 6.0 API for App Linking.
Per the Handling App Links training:
Android 6.0 (API level 23) and higher allow an app to designate itself as the default handler of a given type of link. If the user doesn't want the app to be the default handler, they can override this behavior from Settings.
Automatic handling of links requires the cooperation of app developers and website owners. A developer must configure their app to declare associations with one or more websites, and to request that the system verify those associations. A website owner must, in turn, provide that verification by publishing a Digital Asset Links file.
This involves creating the appropriate intent handler and enabling automatic verification by adding android:autoVerify="true"
:
<activity ...> <intent-filter android:autoVerify="true"> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="http" android:host="www.android.com" /> <data android:scheme="https" android:host="www.android.com" /> </intent-filter> </activity>
Then, updates must be made on the website side by declaring a website association, which ensures that the website owner and the app developer both coordinate to allow the app to autoomatically become the default for a URL scheme.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With