-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.config.ts
168 lines (161 loc) · 4.6 KB
/
app.config.ts
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
import { ConfigContext, ExpoConfig } from "expo/config";
// Use your actual EAS project ID, project slug, and owner.
// These values must remain consistent (except for dynamic parts like bundle identifiers).
const EAS_PROJECT_ID = "dcaa10ce-e677-478d-bd29-90a5108a4cc9";
const PROJECT_SLUG = "tini-time-club";
const OWNER = "hopemediahouse";
// Production config values for Tini Time Club.
const APP_NAME = "Tini Time Club";
const BUNDLE_IDENTIFIER = "com.ohope.tinitimeclub";
const PACKAGE_NAME = "com.ohope.tinitimeclub";
const ICON = "./assets/images/icon-purple.png";
const ADAPTIVE_ICON = "./assets/images/adaptive-icon.png";
const SCHEME = "tini-time-club";
export default ({ config }: ConfigContext): ExpoConfig => {
console.log("⚙️ Building app for environment:", process.env.APP_ENV);
const { name, bundleIdentifier, icon, adaptiveIcon, packageName, scheme } =
getDynamicAppConfig(
(process.env.APP_ENV as "development" | "preview" | "production") ||
"development"
);
return {
...config,
name: name,
version: "1.1.3",
slug: PROJECT_SLUG, // Must be consistent across all environments.
orientation: "portrait",
userInterfaceStyle: "automatic",
newArchEnabled: true,
icon: icon,
scheme: scheme,
ios: {
supportsTablet: true,
bundleIdentifier: bundleIdentifier,
config: {
googleMapsApiKey: "AIzaSyAV4ioL2mbXF0mGeJsKfDUP_wnaDsQQ2nk",
},
infoPlist: {
ITSAppUsesNonExemptEncryption: false,
},
},
android: {
adaptiveIcon: {
foregroundImage: adaptiveIcon,
backgroundColor: "#ffffff",
},
package: packageName,
config: {
googleMaps: {
apiKey: "AIzaSyCGBwGNvHcIKasPMV67MS_RmYOM_2hRRQg",
},
},
permissions: [
"android.permission.RECORD_AUDIO",
"android.permission.ACCESS_COARSE_LOCATION",
"android.permission.ACCESS_FINE_LOCATION",
"android.permission.CAMERA",
],
},
web: {
bundler: "metro",
output: "static",
favicon: "./assets/images/favicon.png",
},
plugins: [
"expo-router",
[
"expo-splash-screen",
{
image: "./assets/images/splash-icon.png",
imageWidth: 200,
resizeMode: "contain",
backgroundColor: "#ffffff",
},
],
// Additional plugins from your original config:
[
"expo-image-picker",
{
photoPermissions:
"Allow Tini Time Club to access your photos to upload an Avatar.",
},
],
[
"expo-location",
{
locationAlwaysAndWhenInUsePermission:
"Allow Tini Time Club to use your location.",
},
],
[
"expo-camera",
{
cameraPermission: "Allow Tini Time Club to access your camera",
microphonePermission:
"Allow Tini Time Club to access your microphone",
recordAudioAndroid: true,
},
],
[
"@react-native-google-signin/google-signin",
{
iosUrlScheme:
"com.googleusercontent.apps.732397011472-41tr3sghlftkc5kcsr57v3570l9uot05",
},
],
],
updates: {
url: `https://u.expo.dev/${EAS_PROJECT_ID}`,
},
runtimeVersion: {
policy: "appVersion",
},
extra: {
eas: {
projectId: EAS_PROJECT_ID,
},
router: {
origin: false,
},
environment: process.env.APP_ENV || "development",
},
experiments: {
typedRoutes: true,
},
owner: OWNER,
};
};
// Dynamically configure the app based on the environment.
export const getDynamicAppConfig = (
environment: "development" | "preview" | "production"
) => {
if (environment === "production") {
return {
name: APP_NAME,
bundleIdentifier: BUNDLE_IDENTIFIER,
packageName: PACKAGE_NAME,
icon: ICON,
adaptiveIcon: ADAPTIVE_ICON,
scheme: SCHEME,
};
}
if (environment === "preview") {
return {
name: `${APP_NAME} Preview`,
bundleIdentifier: `${BUNDLE_IDENTIFIER}.preview`,
packageName: `${PACKAGE_NAME}.preview`,
icon: "./assets/images/icons/iOS-Prev.png",
adaptiveIcon: "./assets/images/icons/Android-Prev.png",
scheme: `${SCHEME}-prev`,
};
}
// Default to "development" configuration.
return {
name: `${APP_NAME} Development`,
bundleIdentifier: `${BUNDLE_IDENTIFIER}.dev`,
packageName: `${PACKAGE_NAME}.dev`,
icon: "./assets/images/icons/iOS-Dev.png",
adaptiveIcon: "./assets/images/icons/Android-Dev.png",
scheme: `${SCHEME}-dev`,
};
};