-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexpo-plugins.js
26 lines (21 loc) · 920 Bytes
/
expo-plugins.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
const { withAndroidManifest } = require('@expo/config-plugins');
const withAndroidMobileWalletAdapter = (config) => {
return withAndroidManifest(config, async (config) => {
const androidManifest = config.modResults.manifest;
// Add necessary intent filter for Solana Mobile Wallet Adapter
const applicationElement = androidManifest['application'][0];
const activityElement = applicationElement['activity'].find(
(activity) => activity.$['android:name'] === '.MainActivity'
);
activityElement['intent-filter'] = [
...(activityElement['intent-filter'] || []),
{
action: [{ $: { 'android:name': 'android.intent.action.VIEW' } }],
data: [{ $: { 'android:scheme': 'solana-wallet' } }],
category: [{ $: { 'android:name': 'android.intent.category.DEFAULT' } }],
},
];
return config;
});
};
module.exports = withAndroidMobileWalletAdapter;