-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp.config.ts
132 lines (124 loc) · 3.35 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
import { ExpoConfig, ConfigContext } from "@expo/config";
type AppEnvType = "development" | "production" | "staging";
const ENV_DEVELOPMENT = "development";
const ENV_PRODUCTION = "production";
const ENV_STAGING = "staging";
const APP_ENV = [ENV_DEVELOPMENT, ENV_PRODUCTION, ENV_STAGING].includes(
process.env.APP_ENV ?? ""
)
? (process.env.APP_ENV as AppEnvType)
: ENV_PRODUCTION;
// Please increase version before start new build
const APP_VERSION = "1.0.3";
const APP_BUILD_NUMBER = 4;
const DEVELOPMENT_CONFIG = {
name: "DoricDev",
slug: "doric-dev",
ios: {
buildNumber: APP_BUILD_NUMBER + "",
requireFullScreen: true,
bundleIdentifier: "com.doric.ios",
googleServicesFile:
"./src/assets/firebase/staging/GoogleService-Info.plist",
},
android: {
versionCode: APP_BUILD_NUMBER,
package: "com.doric.android",
googleServicesFile: "./src/assets/firebase/staging/google-services.json",
},
sentry: {
organization: "doric",
project: "react-native",
},
extra: {
APP_ENV: ENV_DEVELOPMENT,
API_BASE_URL: "http://172.16.2.138:3000",
FACABOOK_ID: "857277571520854",
SENTRY_DSN:
"https://[email protected]/6081229",
},
};
const PRODUCTION_CONFIG = {
name: "Doric",
slug: "doric-prod",
ios: {
buildNumber: APP_BUILD_NUMBER + "",
requireFullScreen: true,
bundleIdentifier: "com.doric.ios",
googleServicesFile:
"./src/assets/firebase/staging/GoogleService-Info.plist",
},
android: {
versionCode: APP_BUILD_NUMBER,
package: "com.doric.android",
googleServicesFile: "./src/assets/firebase/staging/google-services.json",
},
sentry: {
organization: "doric",
project: "react-native",
},
extra: {
APP_ENV: ENV_PRODUCTION,
API_BASE_URL: "http://172.16.2.138:3000",
FACABOOK_ID: "857277571520854",
SENTRY_DSN:
"https://[email protected]/6081229",
},
};
const APP_DEV_CONFIG = {
[ENV_DEVELOPMENT]: DEVELOPMENT_CONFIG,
[ENV_PRODUCTION]: PRODUCTION_CONFIG,
};
export default ({ config }: ConfigContext): ExpoConfig => {
return {
name: APP_DEV_CONFIG[APP_ENV].name,
slug: APP_DEV_CONFIG[APP_ENV].slug,
version: APP_VERSION,
ios: APP_DEV_CONFIG[APP_ENV].ios,
android: APP_DEV_CONFIG[APP_ENV].android,
extra: APP_DEV_CONFIG[APP_ENV].extra,
orientation: "portrait",
icon: "./src/assets/icon.png",
splash: {
image: "./src/assets/sp.png",
resizeMode: "contain",
backgroundColor: "#FFFFFF",
},
assetBundlePatterns: ["**/*"],
androidStatusBar: {
barStyle: "dark-content",
backgroundColor: "#fff",
translucent: false,
},
packagerOpts: {
config: "metro.config.js",
sourceExts: [
"expo.ts",
"expo.tsx",
"expo.js",
"expo.jsx",
"ts",
"tsx",
"js",
"jsx",
"json",
"wasm",
"svg",
"db",
],
},
hooks: {
postPublish: [
{
file: "sentry-expo/upload-sourcemaps",
config: {
organization: APP_DEV_CONFIG[APP_ENV].sentry.organization,
project: APP_DEV_CONFIG[APP_ENV].sentry.project,
authToken:
"9bd230072cd44c628655748f5c866f4a9a39f11c50e546d5a8ae7facae4c5a01",
},
},
],
},
};
};