Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 258
Javier Delgado Avatar asked Oct 30 '16 22:10

Javier Delgado


People also ask

How do I open a deep link on Android?

Select Open deep link URL in a browser option. Click Next. For Android, select Open the deep link in your Android app. Then select your app from the dropdown, in this case the com.

What is difference between app link and deep link?

When a user click an URL, it might open a dialog which asks the user to select one of multiple apps handling the given URL. On the other hand, An Android App Link is a deep link based on your website URL that has been verified to belong to your website. When user clicks that URL, it opens your app.


1 Answers

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.

like image 80
xfdai Avatar answered Sep 28 '22 01:09

xfdai