'How can the android app link detect the URL's path?

Now I am trying to develop the android app links. I have specified the paths so that I can open the app when the URL exactly matches. However, I found that if the host is matched, no matter what the path is, the app will be asked to open. Therefore, I would like to fix it. Thanks very much.

Here is my code:

<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:scheme="http" android:host="www.mydomain.com" android:pathPrefix="[mypath1]" />
<data android:scheme="https" android:host="www.mydomain.com" android:pathPrefix="[mypath]" />
</intent-filter>


Solution 1:[1]

Use Path instead of pathPrefix

<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:scheme="http" android:host="www.mydomain.com" android:path ="/" />
<data android:scheme="https" android:host="www.mydomain.com" android:path ="/" />
</intent-filter>

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Gaurav Rajput