Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Deep link going to PlayStore instead of my app on some devices

Tags:

I've registered the following intent filter in my app's manifest:

    <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:host="m.mycompany.de"             android:pathPattern="/app/list"             android:scheme="http" />     </intent-filter> 

And created a simple html page to test if the app opens correctly:

<!DOCTYPE html PUBLIC "-//IETF//DTD HTML 2.0//EN"> <HTML>    <HEAD>       <TITLE>          A Small Hello        </TITLE>    </HEAD> <BODY>    <a href = "http://m.mycompany.de/app/list?param1=178&param2=87294">Click</a>  </BODY> </HTML> 

On some devices (e.g. Nexus 5 running Android 5.1) clicking the link opens my app as expected, on other devices (e.g. Nexus 6 also running 5.1) the PlayStore (my app's page) is opened instead of my app.

Any ideas what the problem might be?

EDIT: Strangely, this 'bug' is gone when simplifying the URL to :

http://m.mycompany.de/list?param1=178&param2=87294 

and my intent filter to

   <data         android:host="m.mycompany.de"         android:pathPattern="/app"         android:scheme="http" /> 

which is not an option though because I don't have control over the URLs for my live app.

like image 531
fweigl Avatar asked Jul 27 '15 11:07

fweigl


People also ask

How do I integrate a deep link app on Android?

First, you specify the BROWSABLE category so your deep link can work in a browser. Without it, clicking the deep link on a browser won't resolve to your app. Second, the DEFAULT category lets your app handle implicit intents. If it's missing, the intent must specify the app component name for the activity to start.

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.

Can you deep link to another app?

Yes, you can link from another app into your app, and only your app needs the Branch SDK integrated.

How does deeplink work on Android?

A Deep Link is a URL link that is generated, when anyone clicks on that link our app will be open with a specific activity or a screen. Using this URL we can send a message to our app with parameters. In WhatsApp, we can generate a deep link to send a message to a phone number with some message in it.


1 Answers

You can use pathprefix instead of android:pathPattern

<data        android:host="m.mycompany.de"       android:pathPrefix="/app/list"       android:scheme="http" /> 

and in second case when you use below url,

http://m.mycompany.de/list?param1=178&param2=87294

the data tag should be

<data        android:host="m.mycompany.de"       android:pathPrefix="/list"       android:scheme="http" /> 
like image 61
Zilan Pattni Avatar answered Nov 11 '22 09:11

Zilan Pattni