-
Notifications
You must be signed in to change notification settings - Fork 0
/
withAppwriteAuth.js
43 lines (39 loc) · 1.31 KB
/
withAppwriteAuth.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
const { withAndroidManifest } = require("@expo/config-plugins");
/**
* Custom Expo Config Plugin to modify AndroidManifest.xml
* @param {import('@expo/config-plugins').ExpoConfig} config
* @returns {import('@expo/config-plugins').ExpoConfig}
*/
function withAppwriteAuth(config) {
return withAndroidManifest(config, async (config) => {
const appManifest = config.modResults;
appManifest.manifest.application[0].activity = [
...(appManifest.manifest.application[0].activity || []),
{
$: {
"android:name": "io.appwrite.views.CallbackActivity",
"android:exported": "true",
},
"intent-filter": [
{
$: { "android:label": "android_web_auth" },
action: [{ $: { "android:name": "android.intent.action.VIEW" } }],
category: [
{ $: { "android:name": "android.intent.category.DEFAULT" } },
{ $: { "android:name": "android.intent.category.BROWSABLE" } },
],
data: [
{
$: {
"android:scheme": "appwrite-callback-6710b5a600394e11084c",
},
},
],
},
],
},
];
return config;
});
}
module.exports = withAppwriteAuth;