forked from xmtplabs/convos-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.config.ts
More file actions
385 lines (378 loc) · 11 KB
/
app.config.ts
File metadata and controls
385 lines (378 loc) · 11 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
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
import { ExpoConfig } from "expo/config"
import { version } from "./package.json"
type Environment = "development" | "preview" | "production"
type EnvironmentConfig = {
appName: string
scheme: string
webDomain: string
icon: string
ios: {
bundleIdentifier: string
associatedDomains: string[]
googleServicesFile: string
icon?: {
dark: string
light: string
tinted: string
}
}
android: {
package: string
googleServicesFile: string
adaptiveIcon: {
foregroundImage: string
backgroundColor: string
}
}
}
export type IExpoAppConfigExtra = {
webDomain: string
expoEnv: Environment
eas: {
projectId: string
}
}
type ICustomExpoConfig = ExpoConfig & {
extra: IExpoAppConfigExtra
}
const settings: Record<Environment, EnvironmentConfig> = {
development: {
scheme: "convos-dev",
ios: {
bundleIdentifier: "com.convos.dev",
// For now use preview domain for dev
associatedDomains: [
"applinks:preview.convos.org",
"applinks:*.preview.convos.org",
"webcredentials:preview.convos.org",
"webcredentials:*.preview.convos.org",
],
googleServicesFile: "./google-services/google-services-ios-dev.plist",
icon: {
dark: "./assets/icon-dark.png",
light: "./assets/icon-light.png",
tinted: "./assets/icon-tinted.png",
},
},
android: {
package: "com.convos.dev",
googleServicesFile: "./google-services/google-services-android-dev.json",
adaptiveIcon: {
foregroundImage: "./assets/adaptive-icon.png",
backgroundColor: "#FFFFFF",
},
},
// For now use preview domain for dev
webDomain: "preview.convos.org",
appName: "Convos Dev",
icon: "./assets/icon-light.png",
},
preview: {
scheme: "convos-preview",
ios: {
bundleIdentifier: "com.convos.preview",
associatedDomains: [
"applinks:preview.convos.org",
"applinks:*.preview.convos.org",
"webcredentials:preview.convos.org",
"webcredentials:*.preview.convos.org",
],
googleServicesFile: "./google-services/google-services-ios-preview.plist",
icon: {
dark: "./assets/icon-preview-dark.png",
light: "./assets/icon-preview-dark.png",
tinted: "./assets/icon-preview-dark.png",
},
},
android: {
package: "com.convos.preview",
googleServicesFile: "./google-services/google-services-android-preview.json",
adaptiveIcon: {
foregroundImage: "./assets/adaptive-icon.png",
backgroundColor: "#FFFFFF",
},
},
webDomain: "preview.convos.org",
appName: "Convos Preview",
icon: "./assets/icon-light.png",
},
production: {
scheme: "convos",
ios: {
bundleIdentifier: "com.convos.prod",
associatedDomains: [
"applinks:convos.org",
"applinks:*.convos.org",
"webcredentials:convos.org",
"webcredentials:*.convos.org",
],
googleServicesFile: "./google-services/google-services-ios-prod.plist",
icon: {
dark: "./assets/icon-dark.png",
light: "./assets/icon-light.png",
tinted: "./assets/icon-tinted.png",
},
},
android: {
package: "com.convos.prod",
googleServicesFile: "./google-services/google-services-android-prod.json",
adaptiveIcon: {
foregroundImage: "./assets/adaptive-icon.png",
backgroundColor: "#FFFFFF",
},
},
webDomain: "convos.org",
appName: "Convos",
icon: "./assets/icon-light.png",
},
}
export default () => {
const expoEnv = (process.env.EXPO_ENV || "development") as Environment
const config = settings[expoEnv]
return {
name: config.appName,
scheme: config.scheme,
owner: "ephemera",
slug: "convos",
orientation: "portrait",
icon: config.icon,
userInterfaceStyle: "automatic",
version: version,
assetBundlePatterns: ["**/*"],
runtimeVersion: {
policy: "fingerprint",
},
updates: {
url: "https://u.expo.dev/f9089dfa-8871-4aff-93ea-da08af0370d2",
},
extra: {
webDomain: config.webDomain,
expoEnv,
eas: {
projectId: "f9089dfa-8871-4aff-93ea-da08af0370d2",
},
},
ios: {
bundleIdentifier: config.ios.bundleIdentifier,
supportsTablet: true,
associatedDomains: config.ios.associatedDomains,
googleServicesFile: config.ios.googleServicesFile,
icon: config.ios.icon,
config: {
usesNonExemptEncryption: false,
},
entitlements: {
"keychain-access-groups": [
`$(AppIdentifierPrefix)group.${config.ios.bundleIdentifier}`,
`$(AppIdentifierPrefix)${config.ios.bundleIdentifier}`,
],
"com.apple.developer.devicecheck.appattest-environment": "production",
"com.apple.security.application-groups": [`group.${config.ios.bundleIdentifier}`], // For key sharing between app and NSE
"aps-environment": "production", // For now until we really have the correct setup to test notification in local
},
infoPlist: {
LSApplicationQueriesSchemes: [
"cbwallet",
"rainbow",
"metamask",
"trust",
"uniswap",
"zerion",
"exodus",
"oneinch",
"phantom",
"app.phantom",
],
NSAppTransportSecurity: {
// For local development
NSAllowsLocalNetworking: true,
},
// MMKV seems to use "AppGroup" value in info.plist since we are not on new architecture and can't upgrade to v3
// Related to https://github.com/mrousavy/react-native-mmkv/pull/703
AppGroup: `group.${config.ios.bundleIdentifier}`,
AppGroupName: `group.${config.ios.bundleIdentifier}`,
UIBackgroundModes: ["processing"],
},
},
android: {
package: config.android.package,
googleServicesFile: config.android.googleServicesFile,
intentFilters: [
{
action: "VIEW",
category: ["DEFAULT", "BROWSABLE"],
data: [{ scheme: config.scheme }, { scheme: config.android.package }],
},
{
autoVerify: true,
action: "VIEW",
category: ["DEFAULT", "BROWSABLE"],
data: [
{
scheme: "https",
host: config.webDomain,
pathPrefix: "/coinbase",
},
{
scheme: "https",
host: config.webDomain,
pathPrefix: "/",
},
{
scheme: "https",
host: config.webDomain,
pathPrefix: "/dm",
},
{
scheme: "https",
host: config.webDomain,
pathPrefix: "/group-invite",
},
{
scheme: "https",
host: config.webDomain,
pathPrefix: "/group",
},
],
},
],
adaptiveIcon: {
foregroundImage: "./assets/adaptive-icon.png",
backgroundColor: "#FFFFFF",
},
},
plugins: [
"expo-background-task",
["expo-notifications"],
"./plugins/notification-service-extension/app.plugin.js",
["expo-secure-store"],
[
"expo-local-authentication",
{
faceIDPermission: "We need this to use biometrics to secure your data.",
},
],
[
"expo-build-properties",
{
ios: {
// To fix error "The Swift pod `FirebaseCoreInternal` depends upon `GoogleUtilities`,
// which does not define modules. To opt into those targets generating module maps
// (which is necessary to import them from Swift when building as static libraries),
// you may set `use_modular_headers!` globally in your Podfile,
// or specify `:modular_headers => true` for particular dependencies"
useFrameworks: "static",
deploymentTarget: "16.0",
},
android: {
compileSdkVersion: 35,
targetSdkVersion: 34,
buildToolsVersion: "34.0.0",
minSdkVersion: 26,
manifestQueries: {
// Required for Coinbase Wallet integration
package: ["org.toshi"],
// Define supported wallet deep links that our app can open
// This allows Android to show our app as an option when users click wallet links
intent: [
{
action: "VIEW",
data: {
scheme: "cbwallet",
host: "*",
},
},
{
action: "VIEW",
data: {
scheme: "ledgerlive",
host: "*",
},
},
{
action: "VIEW",
data: {
scheme: "rainbow",
host: "*",
},
},
{
action: "VIEW",
data: {
scheme: "metamask",
host: "*",
},
},
{
action: "VIEW",
data: {
scheme: "trust",
host: "*",
},
},
{
action: "VIEW",
data: {
scheme: "uniswap",
host: "*",
},
},
{
action: "VIEW",
data: {
scheme: "zerion",
host: "*",
},
},
{
action: "VIEW",
data: {
scheme: "exodus",
host: "*",
},
},
{
action: "VIEW",
data: {
scheme: "oneinch",
host: "*",
},
},
],
},
},
},
],
[
"expo-image-picker",
{
photosPermission: "We need this so that you can share photos from your library.",
cameraPermission: "We need this so that you can take photos to share.",
},
],
[
"expo-splash-screen",
{
image: "./assets/splash-icon-light.png",
backgroundColor: "#FFFFFF",
dark: {
image: "./assets/splash-icon-dark.png",
backgroundColor: "#000000",
},
imageWidth: 200,
},
],
[
"@sentry/react-native/expo",
{
organization: "ephemerahq",
project: "convos-app-react-native",
url: "https://sentry.io/",
},
],
["@react-native-firebase/app"],
["@react-native-firebase/app-check"],
"./scripts/android/build/android-deps-expo-plugin.js",
],
} as ICustomExpoConfig
}