These three urls are given:
1) https://example.com
2) https://example.com/app
3) https://example.com/app?param=hello
Assumed that i receive a mail in the gmail-app with these three links, I need the following behaviour:
1) Should not open the app
2) Should open the app
3) Should open the app and extract the parameter's value
What i have achieved so far:
<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="example.com"
android:pathPrefix="/app"
android:scheme="https" />
</intent-filter>
This snippet is working fine for the cases 1) and 2): The first url is not opened in the app, the second one is. But the third link sadly i not opened by the app.
I also tried some different variations with path, pathPrefix and pathPattern, but i had no luck achieving all three given behaviours.
So I need your help guys, can you provide a snippet that meets the given requirements or some hints I can test?
Update:
Changing android:pathPrefix to android:pathPattern works now fine: The system's intent chooser is only shown for cases 2) and 3), case 1) opens the browser directly.
but
what I want to achieve additionally is to check for a specific parameter before entering the app or triggering the intent chooser. This should only happen when the parameter param holds the value hello and not goodbye. Is this possible with some kind of regular expression inside the pathPattern-attribute?