Intent filter to open an app from a link not working in Samsung / Firefox browser, etc., but working in Chrome

I have been experimenting with Intent Filters for the past few hours and I am very confused as to why the Google tutorial code for Handling App Links via Intent Filters does not work on my physical Samsung S8 devices by default Samsung or Firefox browser installed on it, however it works from the Google Chrome app.

The code also works in both the default Android Studio Nexus 5 emulator default browser and Google Chrome.

Here is the relevant code I have in AndroidManifest.xml

barebones applications. I am trying to diagnose the problem:

                   

<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" />
    <data android:host="www.android.com"  />
</intent-filter>

      

What I am doing for testing:

I click the link for https://www.android.com on the google search results page.

I expect to see an open dialog with my test apps name, but it doesn't show when I try to do it from anything other than the Chrome Chrome browser (and the default Neusus 5 emulators browser), it just automatically shows the webpage without a popup dialog ...

NB I have also tried the following things so far to no avail:

  • Changing the first line to <intent-filter android:autoVerify="true">

  • Adding a line <data android:host="www.android.com/" />

    in case the problem has anything to do with /

    at the end of the url.
  • Cleans up data and storage of both browsers and generally resets them.

Does anyone know why this is happening / how to fix this?

+3


source to share


2 answers


The browsers themselves must support and implement browsing capabilities. Browsers should find other actions to support android.intent.category.BROWSABLE

when opening a web page.

Firefox implements a less invasive user experience. When a URL opens that has a deep link to the app, the URL bar displays the Android little head action. Clicking on this one will open a link with a non-browser Android activity.

Android and Chrome browser behavior you observed and made your expectation. So nothing to add to that.



I'm not sure if I can fully talk about the Samsung browser, because the versions I have on my devices might be outdated somehow; but I couldn't get it to work with them at all.

The attribute android:autoVerify

makes the application the default when installed. android:host="www.android.com/"

is simply not true because it /

is a path, not a part of the host.

+4


source


Opening the app to specific links only

<intent-filter>
  <action android:name="android.intent.action.VIEW"></action>
  <category android:name="android.intent.category.DEFAULT"></category>
  <category android:name="android.intent.category.BROWSABLE"></category>
  <data android:scheme="spuul"></data>
</intent-filter>

      

This will open all URIs such as spuul: // movies / 123 by the application. The app will then be able to process that URI and launch the correct content. Link to Google Play as in the market: // details? Id = com.spuul.android.



Return to market if app is not installed

<intent-filter>
<action android:name="android.intent.action.VIEW"></action>
<category android:name="android.intent.category.DEFAULT"></category>
<category android:name="android.intent.category.BROWSABLE"></category>
<data android:scheme="http" android:host="android.app.spuul.com" android:pathPrefix=""></data>
</intent-filter>

      

-1


source







All Articles