Our users get emails from time to time to e.g. change their password. When they click the link, I would like to have them sent to our website, but our Android app gets opened.
The link e.g. is https://www.ourdomain.com/change-password/{random-string}
.
We do have deep links enabled in our app, but they are configured the following way:
<intent-filter android:label="...">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="customhost"
android:pathPrefix="/"
android:scheme="https" />
<data
android:host="www.ourdomain.com"
android:pathPrefix="/somethingelse"
android:scheme="https" />
<data
android:host="www.ourdomain.com"
android:pathPrefix="/againsomethingelse"
android:scheme="https" />
<data
android:host="someothercustomhost"
android:scheme="https" />
<data
android:host="andagainacustomhost"
android:scheme="https" />
</intent-filter>
So the change-password
part doesn't fit in any of that configurations, what could be the reason our app gets opened nevertheless?
EDIT
it seems as if the problem is the first data
-tag; if I comment that out, it behaves as expected (i.e. https://www.ourdomain.com/change-password/1234
is not handled by the app). I don't know why as customhost
is a complete different word from www.ourdomain.com
...
You may try to separate it into different <intent-filter>
components, because with one <intent-filter>
application can get confused, even if it is written correctly.
<intent-filter android:label="...">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:host="www.ourdomain.com"
android:pathPrefix="/somethingelse"
android:scheme="https" />
<data android:host="www.ourdomain.com"
android:pathPrefix="/againsomethingelse"
android:scheme="https" />
</intent-filter>
<intent-filter android:label="...">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:host="customhost"
android:pathPrefix="/"
android:scheme="https" />
</intent-filter>
<intent-filter android:label="...">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:host="someothercustomhost"
android:scheme="https" />
</intent-filter>
<intent-filter android:label="...">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:host="andagainacustomhost"
android:scheme="https" />
</intent-filter>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With