How to add a new intent filter
Configure intent filters for deep linking in your Android app.
Add an intent filter so your app opens for the Grovs URL schemes. For https App Links, add the autoVerify filter from the Android Quick Start.
1
Open AndroidManifest.xml
Open app/src/main/AndroidManifest.xml.
2
Add the intent filter
Inside your main activity's <activity> tag, add an <intent-filter> with the VIEW action, the DEFAULT and BROWSABLE categories, and your URL scheme:
XML
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myapp">
<application ... >
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- Define your URL Scheme -->
<data android:scheme="myapp"/>
</intent-filter>
</activity>
</application>
</manifest>Replace myapp with the URL scheme from your Grovs dashboard.
3
Add both schemes
Add both schemes from the dashboard as separate <data> elements in the same filter:
XML
<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:scheme="myapp"/>
<data android:scheme="myapp-test"/>
</intent-filter>Add both URL schemes from the Grovs dashboard. Test and production each need their own.
4
Test with adb
Install the app on a device or emulator and run:
Bash
adb shell am start -W -a android.intent.action.VIEW -d "myapp://example.com/path"Use your dashboard scheme in the URL. The app should open and handle the link.
Was this page helpful?