How to insert intent filter into config.xml so that is inserted correctly in AndroidManifest.xml

Hi all.

I want to use Android app links to link my app with my web site. I am having issues adding intent filters (correctly) so that they’re written to the AndroidManifest.xml when adding Android platform.

Any suggestions are highly appreciated :slight_smile:

Here is my intent filter:

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

And how I was “guessing” to add in config.xml but of course nothing happens when I build the platform:

<platform name="android"> <config-file target="AndroidManifest.xml" parent="./application/activity/[@android:name='MainActivity']"> <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" /> <data android:scheme="https" android:host="www.mydomain.com" /> </intent-filter> </config-file> <config-file target="AndroidManifest.xml" parent="./" mode="add"> <application android:name="customApplication"></application> </config-file> </platform>

Any idea? I was using a hook at the link below but getting all kinds of errors:

So far I copy/paste to AndroidManifest.xml, not very handy. What plugin do you use? I use cordova-plugin-intent but having a trouble to getUri() in my app. Could you share your experience?