Reputation: 4696
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>
Upvotes: 7
Views: 3853
Reputation: 2247
Since the code pasted by you is good for that pathPrefix
, I'm guessing you want to catch only http(s)://(www.)mydomain.com/e
and nothing else?
If this is the case, use path
instead of pathPrefix
like so.
<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:path="/e" />
<data android:scheme="http"
android:host="mydomain.com"
android:path="/e" />
<data android:scheme="https"
android:host="www.mydomain.com"
android:path="/e" />
<data android:scheme="https"
android:host="mydomain.com"
android:path="/e" />
</intent-filter>
Upvotes: 0
Reputation: 5773
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
Since the question is related to pathPrefix, your activity will handle all the urls whose path has a /e at the beginning. For example:
Upvotes: 4