Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deeplink intent filter to a particular pathPrefix?

I've enabled deep linking on my android app and it's working fine.

However, I want the intent-filter to listen to a particular pathPrefix only i.e. http(s)://(www.)mydomain.com/e and not any other pathPrefix.

Is this possible? I'm attaching my intent-filter code in AndroidManifest.xml

<intent-filter android:label="My App Name">
<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"
                android:host="www.domain.com"
                android:pathPrefix="/e" />
            <data android:scheme="http"
                android:host="mydomain.com"
                android:pathPrefix="/e" />
            <data android:scheme="https"
                android:host="www.mydomain.com"
                android:pathPrefix="/e" />
            <data android:scheme="https"
                android:host="mydomain.com"
                android:pathPrefix="/e" />
</intent-filter> 
like image 698
xan Avatar asked Jul 31 '15 20:07

xan


1 Answers

With that piece of manifest, you're telling to your device to launch the Activity that contains that intent filter with all url that have

  1. http or https as protocol
  2. www.mydomain.com or mydomain.com as host
  3. /e as prefix of the path

Since the question is related to pathPrefix, your activity will handle all the urls whose path has a /e at the beginning. For example:

  • http(s)://(www.)mydomain.com/e - MATCH
  • http(s)://(www.)mydomain.com/eXXX - MATCH
  • http(s)://(www.)mydomain.com/e/a - MATCH
  • http(s)://(www.)mydomain.com/eXXX/a - MATCH
  • http(s)://(www.)mydomain.com/e?a=b - MATCH
  • http(s)://(www.)mydomain.com/Xe - DON'T MATCH
  • http(s)://(www.)mydomain.com/X/e?a=b - DON'T MATCH
like image 174
Mimmo Grottoli Avatar answered Sep 30 '22 18:09

Mimmo Grottoli