androidintentfilterdeep-linkingandroid-app-indexingfirebase-app-indexing

Android deep link working only in some websites


I am using app indexing in my app but sometimes it is not receiving correctly the intents from Chrome.

If I open the link from my production website, it is opened by chrome. So I have created a testing site which has the same code. However, in this case, my app is opening the deep link correctly.

I can't find any explanation as it is using the same code in the web (but in diferent sites) and the same Android app.

This is my intent-filter:

        <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="https" android:host="soriabus-web.appspot.com" android:pathPrefix="/" />
        </intent-filter>

This is the html code in my button:

<a href="https://soriabus-web.appspot.com/parada/1/plaza-mariano-granados/true"
"type="button"
role="button"
class="btn btn-primary">
Abrir Soria Bus
</a>

If I open the link in this address (production), it opens Play Store (the end of the link is a redirect to Google Play):

https://soriabus-web.appspot.com/parada/1/plaza-mariano-granados

If I open the link in this other address (test), it opens my app correclty:

https://central-splice-128620.appspot.com/parada/1/plaza-mariano-granados

I don't understand why the links are handled differenty. Thank you.

EDIT:

Is it because I am following a link inside the same site?

https://soriabus-web.appspot.com/parada/1/plaza-mariano-granados => https://soriabus-web.appspot.com/parada/1/plaza-mariano-granados/playstore


Solution

  • If you tested it in Android browser(the default browser until Android 4.2), it works. So it seems it's a feature from Android chrome browser. referred from here: https://developer.chrome.com/multidevice/android/intents

    And Chrome doesn’t launch an external app for a given Intent URI in the following cases.
    
    When the Intent URI is redirected from a typed in URL.
    When the Intent URI is initiated without user gesture.
    

    In your case, it's the same as a typed url.

    You should try the intent:// syntax from above page which is recommended by Google, if you want to open it from chrome.