-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.config.js
More file actions
61 lines (59 loc) · 1.99 KB
/
Copy pathapp.config.js
File metadata and controls
61 lines (59 loc) · 1.99 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// Dynamic config (instead of app.json) so the Google OAuth redirect scheme can
// be derived from EXPO_PUBLIC_GOOGLE_IOS_CLIENT_ID in .env. iOS OAuth clients
// still redirect through the reversed-client-id scheme Google issues per
// client (e.g. com.googleusercontent.apps.<id>), so it has to be registered
// here so the OS routes it back into the app. Android no longer uses a
// redirect at all — Google removed custom-scheme redirects for Android OAuth
// clients, so Android sign-in goes through the native Play Services flow
// (@react-native-google-signin/google-signin) instead, which needs no scheme.
function reversedClientIdScheme(clientId) {
const suffix = '.apps.googleusercontent.com';
if (!clientId || !clientId.endsWith(suffix)) return null;
return `com.googleusercontent.apps.${clientId.slice(0, -suffix.length)}`;
}
const oauthSchemes = [
reversedClientIdScheme(process.env.EXPO_PUBLIC_GOOGLE_IOS_CLIENT_ID),
].filter(Boolean);
module.exports = {
expo: {
name: 'ServiceMyRide',
slug: 'servicemyride',
version: '1.0.4',
orientation: 'portrait',
scheme: ['servicemyride', ...oauthSchemes],
userInterfaceStyle: 'automatic',
icon: './assets/icon.png',
splash: {
resizeMode: 'contain',
backgroundColor: '#0f172a',
},
assetBundlePatterns: ['**/*'],
ios: {
supportsTablet: true,
bundleIdentifier: 'com.servicemyride.app',
},
android: {
package: 'com.servicemyride.app',
versionCode: 3,
adaptiveIcon: {
foregroundImage: './assets/adaptive-icon.png',
backgroundColor: '#0f172a',
},
permissions: [
'android.permission.POST_NOTIFICATIONS',
],
},
plugins: [
'expo-router',
'expo-notifications',
'@react-native-google-signin/google-signin',
[
'expo-image-picker',
{
photosPermission: 'Used to set a photo for a vehicle.',
cameraPermission: 'Used to take a photo of a vehicle.',
},
],
],
},
};