forked from
jollywhoppers.com/witchsky.app
Bluesky app fork with some witchin' additions 馃挮
1// @ts-check
2const pkg = require('./package.json')
3
4/**
5 * @param {import('@expo/config-types').ExpoConfig} _config
6 * @returns {{ expo: import('@expo/config-types').ExpoConfig }}
7 */
8module.exports = function (_config) {
9 /**
10 * App version number. Should be incremented as part of a release cycle.
11 */
12 const VERSION = pkg.version
13
14 /**
15 * Uses built-in Expo env vars
16 *
17 * @see https://docs.expo.dev/build-reference/variables/#built-in-environment-variables
18 */
19 const PLATFORM = process.env.EAS_BUILD_PLATFORM ?? 'web'
20
21 const IS_TESTFLIGHT = process.env.EXPO_PUBLIC_ENV === 'testflight'
22 const IS_PRODUCTION = process.env.EXPO_PUBLIC_ENV === 'production'
23 const IS_DEV = !IS_TESTFLIGHT && !IS_PRODUCTION
24
25 const ASSOCIATED_DOMAINS = [
26 'applinks:bsky.app',
27 'applinks:staging.bsky.app',
28 'appclips:bsky.app',
29 'appclips:go.bsky.app', // Allows App Clip to work when scanning QR codes
30 // When testing local services, enter an ngrok (et al) domain here. It must use a standard HTTP/HTTPS port.
31 ...(IS_DEV || IS_TESTFLIGHT ? [] : []),
32 ]
33
34 const UPDATES_ENABLED = IS_TESTFLIGHT || IS_PRODUCTION
35
36 const USE_SENTRY = Boolean(process.env.SENTRY_AUTH_TOKEN)
37
38 return {
39 expo: {
40 version: VERSION,
41 name: 'Bluesky',
42 slug: 'bluesky',
43 scheme: 'bluesky',
44 owner: 'blueskysocial',
45 runtimeVersion: {
46 policy: 'appVersion',
47 },
48 icon: './assets/app-icons/ios_icon_default_next.png',
49 userInterfaceStyle: 'automatic',
50 primaryColor: '#1083fe',
51 newArchEnabled: false,
52 ios: {
53 supportsTablet: false,
54 bundleIdentifier: 'xyz.blueskyweb.app',
55 config: {
56 usesNonExemptEncryption: false,
57 },
58 icon:
59 PLATFORM === 'web' // web build doesn't like .icon files
60 ? './assets/app-icons/ios_icon_default_next.png'
61 : './assets/app-icons/ios_icon_default.icon',
62 infoPlist: {
63 UIBackgroundModes: ['remote-notification'],
64 NSCameraUsageDescription:
65 'Used for profile pictures, posts, and other kinds of content.',
66 NSMicrophoneUsageDescription:
67 'Used for posts and other kinds of content.',
68 NSPhotoLibraryAddUsageDescription:
69 'Used to save images to your library.',
70 NSPhotoLibraryUsageDescription:
71 'Used for profile pictures, posts, and other kinds of content',
72 CFBundleSpokenName: 'Blue Sky',
73 CFBundleLocalizations: [
74 'en',
75 'an',
76 'ast',
77 'ca',
78 'cy',
79 'da',
80 'de',
81 'el',
82 'eo',
83 'es',
84 'eu',
85 'fi',
86 'fr',
87 'fy',
88 'ga',
89 'gd',
90 'gl',
91 'hi',
92 'hu',
93 'ia',
94 'id',
95 'it',
96 'ja',
97 'km',
98 'ko',
99 'ne',
100 'nl',
101 'pl',
102 'pt-BR',
103 'pt-PT',
104 'ro',
105 'ru',
106 'sv',
107 'th',
108 'tr',
109 'uk',
110 'vi',
111 'yue',
112 'zh-Hans',
113 'zh-Hant',
114 ],
115 UIDesignRequiresCompatibility: true,
116 },
117 associatedDomains: ASSOCIATED_DOMAINS,
118 entitlements: {
119 'com.apple.developer.kernel.increased-memory-limit': true,
120 'com.apple.developer.kernel.extended-virtual-addressing': true,
121 'com.apple.security.application-groups': 'group.app.bsky',
122 },
123 privacyManifests: {
124 NSPrivacyCollectedDataTypes: [
125 {
126 NSPrivacyCollectedDataType: 'NSPrivacyCollectedDataTypeCrashData',
127 NSPrivacyCollectedDataTypeLinked: false,
128 NSPrivacyCollectedDataTypeTracking: false,
129 NSPrivacyCollectedDataTypePurposes: [
130 'NSPrivacyCollectedDataTypePurposeAppFunctionality',
131 ],
132 },
133 {
134 NSPrivacyCollectedDataType:
135 'NSPrivacyCollectedDataTypePerformanceData',
136 NSPrivacyCollectedDataTypeLinked: false,
137 NSPrivacyCollectedDataTypeTracking: false,
138 NSPrivacyCollectedDataTypePurposes: [
139 'NSPrivacyCollectedDataTypePurposeAppFunctionality',
140 ],
141 },
142 {
143 NSPrivacyCollectedDataType:
144 'NSPrivacyCollectedDataTypeOtherDiagnosticData',
145 NSPrivacyCollectedDataTypeLinked: false,
146 NSPrivacyCollectedDataTypeTracking: false,
147 NSPrivacyCollectedDataTypePurposes: [
148 'NSPrivacyCollectedDataTypePurposeAppFunctionality',
149 ],
150 },
151 ],
152 NSPrivacyAccessedAPITypes: [
153 {
154 NSPrivacyAccessedAPIType:
155 'NSPrivacyAccessedAPICategoryFileTimestamp',
156 NSPrivacyAccessedAPITypeReasons: ['C617.1', '3B52.1', '0A2A.1'],
157 },
158 {
159 NSPrivacyAccessedAPIType: 'NSPrivacyAccessedAPICategoryDiskSpace',
160 NSPrivacyAccessedAPITypeReasons: ['E174.1', '85F4.1'],
161 },
162 {
163 NSPrivacyAccessedAPIType:
164 'NSPrivacyAccessedAPICategorySystemBootTime',
165 NSPrivacyAccessedAPITypeReasons: ['35F9.1'],
166 },
167 {
168 NSPrivacyAccessedAPIType:
169 'NSPrivacyAccessedAPICategoryUserDefaults',
170 NSPrivacyAccessedAPITypeReasons: ['CA92.1', '1C8F.1'],
171 },
172 ],
173 },
174 },
175 androidStatusBar: {
176 barStyle: 'light-content',
177 },
178 // Dark nav bar in light mode is better than light nav bar in dark mode
179 androidNavigationBar: {
180 barStyle: 'light-content',
181 },
182 android: {
183 icon: './assets/app-icons/android_icon_default_next.png',
184 adaptiveIcon: {
185 foregroundImage: './assets/icon-android-foreground.png',
186 monochromeImage: './assets/icon-android-monochrome.png',
187 backgroundColor: '#006AFF',
188 },
189 googleServicesFile: './google-services.json',
190 package: 'xyz.blueskyweb.app',
191 intentFilters: [
192 {
193 action: 'VIEW',
194 autoVerify: true,
195 data: [
196 {
197 scheme: 'https',
198 host: 'bsky.app',
199 },
200 ...(IS_DEV
201 ? [
202 {
203 scheme: 'http',
204 host: 'localhost:19006',
205 },
206 ]
207 : []),
208 ],
209 category: ['BROWSABLE', 'DEFAULT'],
210 },
211 ],
212 },
213 web: {
214 favicon: './assets/favicon.png',
215 },
216 updates: {
217 url: 'https://updates.bsky.app/manifest',
218 enabled: UPDATES_ENABLED,
219 fallbackToCacheTimeout: 30000,
220 codeSigningCertificate: UPDATES_ENABLED
221 ? './code-signing/certificate.pem'
222 : undefined,
223 codeSigningMetadata: UPDATES_ENABLED
224 ? {
225 keyid: 'main',
226 alg: 'rsa-v1_5-sha256',
227 }
228 : undefined,
229 checkAutomatically: 'NEVER',
230 },
231 plugins: [
232 'expo-video',
233 'expo-localization',
234 'expo-web-browser',
235 [
236 'react-native-edge-to-edge',
237 {android: {enforceNavigationBarContrast: false}},
238 ],
239 ...(USE_SENTRY
240 ? [
241 /** @type {[string, any]} */ ([
242 '@sentry/react-native/expo',
243 {
244 organization: 'blueskyweb',
245 project: 'app',
246 url: 'https://sentry.io',
247 },
248 ]),
249 ]
250 : []),
251 [
252 'expo-build-properties',
253 {
254 ios: {
255 deploymentTarget: '15.1',
256 buildReactNativeFromSource: true,
257 ccacheEnabled: IS_DEV,
258 },
259 android: {
260 compileSdkVersion: 35,
261 targetSdkVersion: 35,
262 buildToolsVersion: '35.0.0',
263 buildReactNativeFromSource: IS_PRODUCTION,
264 },
265 },
266 ],
267 [
268 'expo-notifications',
269 {
270 icon: './assets/icon-android-notification.png',
271 color: '#1185fe',
272 sounds: PLATFORM === 'ios' ? ['assets/dm.aiff'] : ['assets/dm.mp3'],
273 },
274 ],
275 'react-native-compressor',
276 [
277 '@bitdrift/react-native',
278 {
279 networkInstrumentation: true,
280 },
281 ],
282 './plugins/starterPackAppClipExtension/withStarterPackAppClip.js',
283 './plugins/withGradleJVMHeapSizeIncrease.js',
284 './plugins/withAndroidManifestLargeHeapPlugin.js',
285 './plugins/withAndroidManifestFCMIconPlugin.js',
286 './plugins/withAndroidManifestIntentQueriesPlugin.js',
287 './plugins/withAndroidStylesAccentColorPlugin.js',
288 './plugins/withAndroidDayNightThemePlugin.js',
289 './plugins/withAndroidNoJitpackPlugin.js',
290 './plugins/shareExtension/withShareExtensions.js',
291 './plugins/notificationsExtension/withNotificationsExtension.js',
292 [
293 'expo-font',
294 {
295 fonts: [
296 './assets/fonts/inter/InterVariable.woff2',
297 './assets/fonts/inter/InterVariable-Italic.woff2',
298 // Android only
299 './assets/fonts/inter/Inter-Regular.otf',
300 './assets/fonts/inter/Inter-Italic.otf',
301 './assets/fonts/inter/Inter-Medium.otf',
302 './assets/fonts/inter/Inter-MediumItalic.otf',
303 './assets/fonts/inter/Inter-SemiBold.otf',
304 './assets/fonts/inter/Inter-SemiBoldItalic.otf',
305 './assets/fonts/inter/Inter-Bold.otf',
306 './assets/fonts/inter/Inter-BoldItalic.otf',
307 ],
308 },
309 ],
310 [
311 'expo-splash-screen',
312 {
313 ios: {
314 enableFullScreenImage_legacy: true, // iOS only
315 backgroundColor: '#A8CCFF', // primary_200
316 image: './assets/splash/splash.png',
317 resizeMode: 'cover',
318 dark: {
319 enableFullScreenImage_legacy: true, // iOS only
320 backgroundColor: '#00398A', // primary_800
321 image: './assets/splash/splash-dark.png',
322 resizeMode: 'cover',
323 },
324 },
325 android: {
326 backgroundColor: '#A8CCFF', // primary_200
327 image: './assets/splash/android-splash-logo-white.png',
328 imageWidth: 105,
329 dark: {
330 backgroundColor: '#00398A', // primary_800
331 image: './assets/splash/android-splash-logo-white.png',
332 imageWidth: 105,
333 },
334 },
335 },
336 ],
337 [
338 '@mozzius/expo-dynamic-app-icon',
339 {
340 /**
341 * Default set
342 */
343 default_light: {
344 ios: './assets/app-icons/ios_icon_legacy_light.png',
345 android: './assets/app-icons/android_icon_legacy_light.png',
346 prerendered: true,
347 },
348 default_dark: {
349 ios: './assets/app-icons/ios_icon_legacy_dark.png',
350 android: './assets/app-icons/android_icon_legacy_dark.png',
351 prerendered: true,
352 },
353
354 /**
355 * Bluesky+ core set
356 */
357 core_aurora: {
358 ios: './assets/app-icons/ios_icon_core_aurora.png',
359 android: './assets/app-icons/android_icon_core_aurora.png',
360 prerendered: true,
361 },
362 core_bonfire: {
363 ios: './assets/app-icons/ios_icon_core_bonfire.png',
364 android: './assets/app-icons/android_icon_core_bonfire.png',
365 prerendered: true,
366 },
367 core_sunrise: {
368 ios: './assets/app-icons/ios_icon_core_sunrise.png',
369 android: './assets/app-icons/android_icon_core_sunrise.png',
370 prerendered: true,
371 },
372 core_sunset: {
373 ios: './assets/app-icons/ios_icon_core_sunset.png',
374 android: './assets/app-icons/android_icon_core_sunset.png',
375 prerendered: true,
376 },
377 core_midnight: {
378 ios: './assets/app-icons/ios_icon_core_midnight.png',
379 android: './assets/app-icons/android_icon_core_midnight.png',
380 prerendered: true,
381 },
382 core_flat_blue: {
383 ios: './assets/app-icons/ios_icon_core_flat_blue.png',
384 android: './assets/app-icons/android_icon_core_flat_blue.png',
385 prerendered: true,
386 },
387 core_flat_white: {
388 ios: './assets/app-icons/ios_icon_core_flat_white.png',
389 android: './assets/app-icons/android_icon_core_flat_white.png',
390 prerendered: true,
391 },
392 core_flat_black: {
393 ios: './assets/app-icons/ios_icon_core_flat_black.png',
394 android: './assets/app-icons/android_icon_core_flat_black.png',
395 prerendered: true,
396 },
397 core_classic: {
398 ios: './assets/app-icons/ios_icon_core_classic.png',
399 android: './assets/app-icons/android_icon_core_classic.png',
400 prerendered: true,
401 },
402 },
403 ],
404 ['expo-screen-orientation', {initialOrientation: 'PORTRAIT_UP'}],
405 ['expo-location'],
406 [
407 'expo-contacts',
408 {
409 contactsPermission:
410 'I agree to allow Bluesky to use my contacts for friend discovery until I opt out.',
411 },
412 ],
413 ],
414 extra: {
415 eas: {
416 build: {
417 experimental: {
418 ios: {
419 appExtensions: [
420 {
421 targetName: 'Share-with-Bluesky',
422 bundleIdentifier: 'xyz.blueskyweb.app.Share-with-Bluesky',
423 entitlements: {
424 'com.apple.security.application-groups': [
425 'group.app.bsky',
426 ],
427 },
428 },
429 {
430 targetName: 'BlueskyNSE',
431 bundleIdentifier: 'xyz.blueskyweb.app.BlueskyNSE',
432 entitlements: {
433 'com.apple.security.application-groups': [
434 'group.app.bsky',
435 ],
436 },
437 },
438 {
439 targetName: 'BlueskyClip',
440 bundleIdentifier: 'xyz.blueskyweb.app.AppClip',
441 },
442 ],
443 },
444 },
445 },
446 projectId: '55bd077a-d905-4184-9c7f-94789ba0f302',
447 },
448 },
449 },
450 }
451}