Following the suggestions from How to add my browser in the default browser selection list in android?. I have specified my Intent
in the manifest
file:
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="http"/>
<data android:scheme="https"/>
</intent-filter>
I have also added the permission:
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
But still my browser is not showing in the default app options for the browser category in the settings.
Do I need to do anything else for my app to show up in the default options for browser?
For example, Android devices with stock OS usually come with Google Chrome set as their default browser but in brands like Samsung and Apple, the default browser is different. Apple phones use Safari as their default browser, whereas Samsung devices come pre-loaded with Samsung Internet Browser.
The default browser is the web browser that is automatically used when opening a web page or clicking on a web link.
Try to include the <category android:name="android.intent.category.BROWSABLE" />
in your target activity's intent-filter
as developer documentation said:
If the user is viewing a web page or an e-mail and clicks on a link in the text, the Intent generated execute that link will require the
BROWSABLE
category, so that only activities supporting this category will be considered as possible actions.
It is required in order for the intent-filter
to be accessible from a clickable link. Without it, clicking a link cannot resolve to your app.
<activity ...>
<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:scheme="http" />
<data android:scheme="https" />
</intent-filter>
</activity>
.
Android App Links on 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 their device's system settings.
To enable link handling verification for your app, set android:autoVerify="true"
in intent-filter
tag:
<activity ...>
<intent-filter android:autoVerify="true">
...
</intent-filter>
</activity>
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