mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
1const pkg = require('./package.json')
2
3const SPLASH_CONFIG = {
4 backgroundColor: '#ffffff',
5 image: './assets/splash.png',
6 resizeMode: 'cover',
7}
8const DARK_SPLASH_CONFIG = {
9 backgroundColor: '#001429',
10 image: './assets/splash-dark.png',
11 resizeMode: 'cover',
12}
13
14const SPLASH_CONFIG_ANDROID = {
15 backgroundColor: '#0c7cff',
16 image: './assets/splash.png',
17 resizeMode: 'cover',
18}
19const DARK_SPLASH_CONFIG_ANDROID = {
20 backgroundColor: '#0f141b',
21 image: './assets/splash-dark.png',
22 resizeMode: 'cover',
23}
24
25module.exports = function (config) {
26 /**
27 * App version number. Should be incremented as part of a release cycle.
28 */
29 const VERSION = pkg.version
30
31 /**
32 * Uses built-in Expo env vars
33 *
34 * @see https://docs.expo.dev/build-reference/variables/#built-in-environment-variables
35 */
36 const PLATFORM = process.env.EAS_BUILD_PLATFORM
37
38 const IS_DEV = process.env.EXPO_PUBLIC_ENV === 'development'
39 const IS_TESTFLIGHT = process.env.EXPO_PUBLIC_ENV === 'testflight'
40 const IS_PRODUCTION = process.env.EXPO_PUBLIC_ENV === 'production'
41
42 const UPDATES_CHANNEL = IS_TESTFLIGHT
43 ? 'testflight'
44 : IS_PRODUCTION
45 ? 'production'
46 : undefined
47 const UPDATES_ENABLED = !!UPDATES_CHANNEL
48
49 const SENTRY_DIST = `${PLATFORM}.${VERSION}.${IS_TESTFLIGHT ? 'tf' : ''}${
50 IS_DEV ? 'dev' : ''
51 }`
52
53 return {
54 expo: {
55 version: VERSION,
56 name: 'Bluesky',
57 slug: 'bluesky',
58 scheme: 'bluesky',
59 owner: 'blueskysocial',
60 runtimeVersion: {
61 policy: 'appVersion',
62 },
63 orientation: 'portrait',
64 icon: './assets/icon.png',
65 userInterfaceStyle: 'automatic',
66 splash: SPLASH_CONFIG,
67 // hsl(211, 99%, 53%), same as palette.default.brandText
68 primaryColor: '#1083fe',
69 ios: {
70 supportsTablet: false,
71 bundleIdentifier: 'xyz.blueskyweb.app',
72 config: {
73 usesNonExemptEncryption: false,
74 },
75 infoPlist: {
76 UIBackgroundModes: ['remote-notification'],
77 NSCameraUsageDescription:
78 'Used for profile pictures, posts, and other kinds of content.',
79 NSMicrophoneUsageDescription:
80 'Used for posts and other kinds of content.',
81 NSPhotoLibraryAddUsageDescription:
82 'Used to save images to your library.',
83 NSPhotoLibraryUsageDescription:
84 'Used for profile pictures, posts, and other kinds of content',
85 },
86 associatedDomains: ['applinks:bsky.app', 'applinks:staging.bsky.app'],
87 splash: {
88 ...SPLASH_CONFIG,
89 dark: DARK_SPLASH_CONFIG,
90 },
91 entitlements: {
92 'com.apple.security.application-groups': 'group.app.bsky',
93 },
94 privacyManifests: {
95 NSPrivacyAccessedAPITypes: [
96 {
97 NSPrivacyAccessedAPIType:
98 'NSPrivacyAccessedAPICategoryFileTimestamp',
99 NSPrivacyAccessedAPITypeReasons: ['C617.1', '3B52.1', '0A2A.1'],
100 },
101 {
102 NSPrivacyAccessedAPIType: 'NSPrivacyAccessedAPICategoryDiskSpace',
103 NSPrivacyAccessedAPITypeReasons: ['E174.1', '85F4.1'],
104 },
105 {
106 NSPrivacyAccessedAPIType:
107 'NSPrivacyAccessedAPICategorySystemBootTime',
108 NSPrivacyAccessedAPITypeReasons: ['35F9.1'],
109 },
110 {
111 NSPrivacyAccessedAPIType:
112 'NSPrivacyAccessedAPICategoryUserDefaults',
113 NSPrivacyAccessedAPITypeReasons: ['CA92.1', '1C8F.1'],
114 },
115 ],
116 },
117 },
118 androidStatusBar: {
119 barStyle: 'light-content',
120 backgroundColor: '#00000000',
121 },
122 // Dark nav bar in light mode is better than light nav bar in dark mode
123 androidNavigationBar: {
124 barStyle: 'light-content',
125 backgroundColor: DARK_SPLASH_CONFIG_ANDROID.backgroundColor,
126 },
127 android: {
128 icon: './assets/icon.png',
129 adaptiveIcon: {
130 foregroundImage: './assets/icon-android-foreground.png',
131 monochromeImage: './assets/icon-android-foreground.png',
132 backgroundImage: './assets/icon-android-background.png',
133 backgroundColor: '#1185FE',
134 },
135 googleServicesFile: './google-services.json',
136 package: 'xyz.blueskyweb.app',
137 intentFilters: [
138 {
139 action: 'VIEW',
140 autoVerify: true,
141 data: [
142 {
143 scheme: 'https',
144 host: 'bsky.app',
145 },
146 IS_DEV && {
147 scheme: 'http',
148 host: 'localhost:19006',
149 },
150 ],
151 category: ['BROWSABLE', 'DEFAULT'],
152 },
153 ],
154 splash: {
155 ...SPLASH_CONFIG_ANDROID,
156 dark: DARK_SPLASH_CONFIG_ANDROID,
157 },
158 },
159 web: {
160 favicon: './assets/favicon.png',
161 },
162 updates: {
163 url: 'https://updates.bsky.app/manifest',
164 enabled: UPDATES_ENABLED,
165 fallbackToCacheTimeout: 30000,
166 codeSigningCertificate: UPDATES_ENABLED
167 ? './code-signing/certificate.pem'
168 : undefined,
169 codeSigningMetadata: UPDATES_ENABLED
170 ? {
171 keyid: 'main',
172 alg: 'rsa-v1_5-sha256',
173 }
174 : undefined,
175 checkAutomatically: 'NEVER',
176 channel: UPDATES_CHANNEL,
177 },
178 plugins: [
179 'expo-localization',
180 Boolean(process.env.SENTRY_AUTH_TOKEN) && 'sentry-expo',
181 [
182 'expo-build-properties',
183 {
184 ios: {
185 deploymentTarget: '14.0',
186 newArchEnabled: false,
187 },
188 android: {
189 compileSdkVersion: 34,
190 targetSdkVersion: 34,
191 buildToolsVersion: '34.0.0',
192 kotlinVersion: '1.8.0',
193 newArchEnabled: false,
194 },
195 },
196 ],
197 [
198 'expo-notifications',
199 {
200 icon: './assets/icon-android-notification.png',
201 color: '#1185fe',
202 sounds: PLATFORM === 'ios' ? ['assets/dm.aiff'] : ['assets/dm.mp3'],
203 },
204 ],
205 './plugins/withAndroidManifestPlugin.js',
206 './plugins/withAndroidManifestFCMIconPlugin.js',
207 './plugins/withAndroidManifestLaunchModePlugin.js',
208 './plugins/withAndroidStylesWindowBackgroundPlugin.js',
209 './plugins/withAndroidStylesAccentColorPlugin.js',
210 './plugins/withAndroidSplashScreenStatusBarTranslucentPlugin.js',
211 './plugins/shareExtension/withShareExtensions.js',
212 './plugins/notificationsExtension/withNotificationsExtension.js',
213 ].filter(Boolean),
214 extra: {
215 eas: {
216 build: {
217 experimental: {
218 ios: {
219 appExtensions: [
220 {
221 targetName: 'Share-with-Bluesky',
222 bundleIdentifier: 'xyz.blueskyweb.app.Share-with-Bluesky',
223 entitlements: {
224 'com.apple.security.application-groups': [
225 'group.app.bsky',
226 ],
227 },
228 },
229 {
230 targetName: 'BlueskyNSE',
231 bundleIdentifier: 'xyz.blueskyweb.app.BlueskyNSE',
232 entitlements: {
233 'com.apple.security.application-groups': [
234 'group.app.bsky',
235 ],
236 },
237 },
238 ],
239 },
240 },
241 },
242 projectId: '55bd077a-d905-4184-9c7f-94789ba0f302',
243 },
244 },
245 hooks: {
246 postPublish: [
247 /*
248 * @see https://docs.expo.dev/guides/using-sentry/#app-configuration
249 */
250 {
251 file: 'sentry-expo/upload-sourcemaps',
252 config: {
253 organization: 'blueskyweb',
254 project: 'react-native',
255 release: VERSION,
256 dist: SENTRY_DIST,
257 },
258 },
259 ],
260 },
261 },
262 }
263}