-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.config.ts
More file actions
59 lines (50 loc) · 1.46 KB
/
app.config.ts
File metadata and controls
59 lines (50 loc) · 1.46 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
import { ConfigContext, ExpoConfig } from 'expo/config';
const IS_DEV = process.env.APP_VARIANT === 'development';
const IS_PREVIEW = process.env.APP_VARIANT === 'preview';
const getUniqueIdentifier = (): string => {
if (IS_DEV) {
return 'com.perpetualprotocol.riverrun.dev';
}
if (IS_PREVIEW) {
return 'com.perpetualprotocol.riverrun.preview';
}
return 'com.perpetualprotocol.riverrun';
};
const getAppName = (): string => {
if (IS_DEV) {
return 'PERP GO (Dev)';
}
if (IS_PREVIEW) {
return 'PERP GO (Preview)';
}
return 'PERP GO';
};
export default ({ config }: ConfigContext): ExpoConfig => {
if (!config.slug) {
throw new Error('slug is required in app.json');
}
return {
...config,
slug: config.slug,
// Dynamic app name based on variant
name: getAppName(),
// Dynamic bundle identifiers for iOS and Android
ios: {
...config.ios,
bundleIdentifier: getUniqueIdentifier(),
},
android: {
...config.android,
package: getUniqueIdentifier(),
},
// Pass app variant to runtime
extra: {
...config.extra,
appVariant: process.env.APP_VARIANT,
// Segment write key - build-time variable from EAS environment (not EXPO_PUBLIC_ to keep it private)
segmentWriteKey: process.env.SEGMENT_WRITE_KEY,
// Backend API base URL for notification service
backendApiBaseUrl: process.env.BACKEND_API_BASE_URL || 'https://api.go.perp.com',
},
};
};