-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.config.ts
More file actions
95 lines (89 loc) · 2.36 KB
/
app.config.ts
File metadata and controls
95 lines (89 loc) · 2.36 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
import "dotenv/config";
import type {ExpoConfig} from "@expo/config-types";
const EAS_OWNER = process.env.EAS_OWNER; // by https://www.binnicordova.com
const EAS_SLUG = "tokai";
const EAS_PROJECT_ID = process.env.EAS_PROJECT_ID;
const VERSION = "0.0.1";
const VERSION_CODE = 2;
const APP_VARIANTS = {
development: {
identifier: "com.tokai.dev",
name: "TokAI (Dev)",
scheme: "dev.tokai.com",
},
preview: {
identifier: "com.tokai.preview",
name: "TokAI (Preview)",
scheme: "preview.tokai.com",
},
production: {
identifier: "com.tokai",
name: "TokAI",
scheme: "tokai.com",
},
};
const getAppVariant = () => {
if (process.env.APP_VARIANT === "development")
return APP_VARIANTS.development;
if (process.env.APP_VARIANT === "preview") return APP_VARIANTS.preview;
return APP_VARIANTS.production;
};
const getUniqueIdentifier = () => getAppVariant().identifier;
const getAppName = () => getAppVariant().name;
const getScheme = () => getAppVariant().scheme;
export default ({config}: {config: ExpoConfig}): ExpoConfig => ({
...config,
name: getAppName(),
scheme: getScheme(),
slug: EAS_SLUG,
version: VERSION,
orientation: "portrait",
icon: "./assets/icon.png",
newArchEnabled: true,
splash: {
image: "./assets/splash.png",
resizeMode: "cover",
backgroundColor: "#ffffff",
},
updates: {
fallbackToCacheTimeout: 0,
url: `https://u.expo.dev/${EAS_PROJECT_ID}`,
enabled: true,
},
assetBundlePatterns: ["**/*"],
ios: {
supportsTablet: true,
bundleIdentifier: getUniqueIdentifier(),
},
android: {
adaptiveIcon: {
foregroundImage: "./assets/adaptive-icon.png",
backgroundColor: "#FFFFFF",
},
package: getUniqueIdentifier(),
},
web: {
favicon: "./assets/favicon.png",
bundler: "metro",
},
extra: {
router: {
root: "src/app",
},
eas: {
projectId: EAS_PROJECT_ID,
},
},
owner: EAS_OWNER,
runtimeVersion: `${VERSION}+${VERSION_CODE}`,
userInterfaceStyle: "automatic",
plugins: [
[
"expo-router",
{
root: "src/app",
},
],
"expo-background-task",
],
});