I have implemented deep linking to my app successfully but I am stuck with a problem.
<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:host="*.example.com"
android:scheme="https"/>
</intent-filter>
This intent filter handles all the links but I don't want to catch a certain url i.e.
https://www.example.com/hello/redirect/
What I tried so far:
I tried entering all the URLs that I want to catch manually
<data
android:host="*example.com"
android:scheme="https"
android:pathPrefix="/m/">
<data
android:host="*example.com"
android:scheme="https"
android:pathPrefix="/c/">
<data
android:host="*example.com"
android:scheme="https"
android:pathPrefix="/p/">
...
But then my home page URL https://www.example.com
doesn't work.
If i use
android:pathPrefix="/"
then this will start catching all the URLs again including the url i want to omit.
I also tried using android:pathPattern
, but it can't understand a complicated regex like this ^((?!redirect).)*$
which works fine when I try it in strings and all.
Anybody know how can I omit certain URLs?
UPDATE:
As suggested by @PLNech here, I added all the URLs that I need to catch using android:pathPrefix
and use android:path: "/"
to catch the URL of my home page i.e. https://www.example.com/
<data
android:host="*.example.com"
android:scheme="https"
android:path="/"/>
<data
android:host="*example.com"
android:scheme="https"
android:pathPrefix="/m/">
<data
android:host="*example.com"
android:scheme="https"
android:pathPrefix="/c/">
<data
android:host="*example.com"
android:scheme="https"
android:pathPrefix="/p/">