-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.config.js
161 lines (142 loc) · 3.51 KB
/
app.config.js
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
// @ts-check
import withBuildProperties from 'expo-build-properties'
import {
AndroidConfig,
withAndroidColorsNight,
withAndroidStyles,
withGradleProperties,
} from 'expo/config-plugins'
// eslint-disable-next-line no-undef
const IS_DEV = !!process.env.DEV
const id = IS_DEV
? 'com.leaftail1880.xdnevnik.dev'
: 'com.leaftail1880.xdnevnik'
const sentry = {
organization: 'leaftail1880',
project: 'xdnevnik',
}
const splashBackgroundDark = '#252525'
const splashBackgroundLight = '#EBEAEA'
/** @type {import("@expo/config-types/build/ExpoConfig.js").ExpoConfig['splash']} */
const splash = {
image: './assets/splash.png',
resizeMode: 'cover',
backgroundColor: splashBackgroundLight,
dark: {
image: './assets/splash.png',
resizeMode: 'cover',
backgroundColor: splashBackgroundDark,
},
}
const projectId = '97163afe-5c7e-4856-ba8f-348e00aa7c04'
/** @type {{expo: import("@expo/config-types/build/ExpoConfig.js").ExpoConfig}} */
const Config = {
expo: {
name: IS_DEV ? 'XDnevnik Dev Client' : 'XDnevnik',
slug: 'xdnevnik',
version: '0.16.0',
owner: 'leaftail1880',
orientation: 'portrait',
icon: './assets/icon.png',
assetBundlePatterns: ['**/*'],
userInterfaceStyle: 'automatic',
notification: {
icon: './assets/notification_icon.png',
color: splashBackgroundLight,
},
ios: {
bundleIdentifier: id,
splash: splash,
userInterfaceStyle: 'automatic',
infoPlist: {
UIBackgroundModes: ['lesson-notifications'],
},
},
android: {
package: id,
splash: splash,
userInterfaceStyle: 'automatic',
permissions: ['FOREGROUND_SERVICE', 'REQUEST_INSTALL_PACKAGES'],
adaptiveIcon: {
foregroundImage: './assets/adaptive-icon.png',
backgroundColor: splashBackgroundLight,
},
},
plugins: [
IS_DEV ? 'expo-dev-client' : '',
'expo-updates',
'expo-build-properties',
['@sentry/react-native/expo', sentry],
[
'expo-navigation-bar',
{
position: 'relative',
visibility: 'visible',
behavior: 'inset-swipe',
},
],
],
runtimeVersion: {
policy: 'appVersion',
},
updates: {
url: `https://u.expo.dev/${projectId}`,
},
extra: {
eas: {
projectId: projectId,
},
},
},
}
Config.expo.plugins = Config.expo.plugins?.filter(Boolean)
Config.expo = withBuildProperties(Config.expo, {
android: {
enableProguardInReleaseBuilds: true,
enableShrinkResourcesInReleaseBuilds: true,
useLegacyPackaging: true,
},
})
Config.expo = withGradleProperties(Config.expo, config => {
config.modResults.push(
{
type: 'property',
key: 'reactNativeArchitectures',
value: 'armeabi-v7a,arm64-v8a', //,x86,x86_64
},
{
type: 'property',
key: 'org.gradle.jvmargs',
value: '-Xmx3096m -XX:MaxMetaspaceSize=512m',
},
{
type: 'property',
key: 'gradle',
value: 'build -x lint -x lintVitalRelease',
}
)
return config
})
// Adjust color of the android status bar during splash screen
const { assignColorValue } = AndroidConfig.Colors
Config.expo = withAndroidColorsNight(Config.expo, async config => {
config.modResults = assignColorValue(config.modResults, {
name: 'colorPrimaryDark',
value: splashBackgroundDark,
})
return config
})
// Make dark theme properly work on Xiaomi devices
Config.expo = withAndroidStyles(Config.expo, config => {
config.modResults = AndroidConfig.Styles.assignStylesValue(
config.modResults,
{
add: true,
parent: AndroidConfig.Styles.getAppThemeLightNoActionBarGroup(),
name: `android:forceDarkAllowed`,
value: 'false',
}
)
return config
})
export default Config