Add <queries> to AndroidManifest.xml

I’m using Expo 47 and a targetSdkVersion of 33 for Android in my app.json file. To use a particular feature in the Razorpay React Native library, they require me to modify my manifest file on Android.

I would like to add the following to my AndroidManifest.xml while preserving other modifications made to the file by other config plugins:

<queries>
    <package android:name="com.google.android.apps.nbu.paisa.user" />
    <package android:name="com.phonepe.app"/>
    <package android:name="net.one97.paytm"/>
    <package android:name="in.org.npci.upiapp"/>

    <intent>
        <action android:name="android.intent.action.SEND" />
    </intent>
</queries>

I’m new to Config Plugins and unable to build a plugin by myself. Any help on how to achieve this is appreciated! Thanks.

I’m also looking to do this so that I can use Linking.canOpenUrl(...) for a URL with the fb:// scheme.

Is this something that is supported already or is there a workaround?

Hi @tiltbike and @eucal

Maybe this will give you some hints: rn-hce-test/plugins at main · wodin/rn-hce-test · GitHub

Also try searching for uses of withAndroidManifest in the expo/expo repository and expo/config-plugins.

Also see: xml2js - npm

Thanks @wodin!