Reputation: 1103
I have followed tutorials from Deep Links to App Content.
However my app can't intercept the links. The app can't be launched at all.
Here is part of my Android manifest:
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter >
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- Accepts URIs that begin with "http://www.example.com/gizmos” -->
<data android:scheme="http"
android:host="www.example.com"
android:pathPrefix="/gizmos" />
<!-- note that the leading "/" is required for pathPrefix-->
</intent-filter>
</activity>
Here is the test page index.html i put on my web server.
<a id="applink1" href="http://www.example.com/gizmos/sss">
Open Application</a>
I have tried hours and still can't figure out why it doesn't work.
Ps:
If I change scheme to some random stuff, it will work.
However I want to intercept the http link.
I also tried change the order of action, category, data, it makes no difference.
Upvotes: 0
Views: 65
Reputation: 5805
Additionally to the Android portion, you need to verify that you are indeed allowed to intercept links for the given URL on the web server serving the URL. To do that, you need to create and upload a JSON file to the given URL (under .well-known/assetlinks.json
) that contains verification information about your app, effectively allowing your app to intercept links.
See https://developer.android.com/training/app-links/verify-site-associations.html for the details.
Upvotes: 1