mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
at verify-code 279 lines 8.8 kB view raw
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 ASSOCIATED_DOMAINS = [ 43 'applinks:bsky.app', 44 'applinks:staging.bsky.app', 45 'appclips:bsky.app', 46 'appclips:go.bsky.app', // Allows App Clip to work when scanning QR codes 47 // When testing local services, enter an ngrok (et al) domain here. It must use a standard HTTP/HTTPS port. 48 ...(IS_DEV || IS_TESTFLIGHT ? [] : []), 49 ] 50 51 const UPDATES_CHANNEL = IS_TESTFLIGHT 52 ? 'testflight' 53 : IS_PRODUCTION 54 ? 'production' 55 : undefined 56 const UPDATES_ENABLED = !!UPDATES_CHANNEL 57 58 const SENTRY_DIST = `${PLATFORM}.${VERSION}.${IS_TESTFLIGHT ? 'tf' : ''}${ 59 IS_DEV ? 'dev' : '' 60 }` 61 62 return { 63 expo: { 64 version: VERSION, 65 name: 'Bluesky', 66 slug: 'bluesky', 67 scheme: 'bluesky', 68 owner: 'blueskysocial', 69 runtimeVersion: { 70 policy: 'appVersion', 71 }, 72 orientation: 'portrait', 73 icon: './assets/icon.png', 74 userInterfaceStyle: 'automatic', 75 splash: SPLASH_CONFIG, 76 // hsl(211, 99%, 53%), same as palette.default.brandText 77 primaryColor: '#1083fe', 78 ios: { 79 supportsTablet: false, 80 bundleIdentifier: 'xyz.blueskyweb.app', 81 config: { 82 usesNonExemptEncryption: false, 83 }, 84 infoPlist: { 85 UIBackgroundModes: ['remote-notification'], 86 NSCameraUsageDescription: 87 'Used for profile pictures, posts, and other kinds of content.', 88 NSMicrophoneUsageDescription: 89 'Used for posts and other kinds of content.', 90 NSPhotoLibraryAddUsageDescription: 91 'Used to save images to your library.', 92 NSPhotoLibraryUsageDescription: 93 'Used for profile pictures, posts, and other kinds of content', 94 }, 95 associatedDomains: ASSOCIATED_DOMAINS, 96 splash: { 97 ...SPLASH_CONFIG, 98 dark: DARK_SPLASH_CONFIG, 99 }, 100 entitlements: { 101 'com.apple.security.application-groups': 'group.app.bsky', 102 }, 103 privacyManifests: { 104 NSPrivacyAccessedAPITypes: [ 105 { 106 NSPrivacyAccessedAPIType: 107 'NSPrivacyAccessedAPICategoryFileTimestamp', 108 NSPrivacyAccessedAPITypeReasons: ['C617.1', '3B52.1', '0A2A.1'], 109 }, 110 { 111 NSPrivacyAccessedAPIType: 'NSPrivacyAccessedAPICategoryDiskSpace', 112 NSPrivacyAccessedAPITypeReasons: ['E174.1', '85F4.1'], 113 }, 114 { 115 NSPrivacyAccessedAPIType: 116 'NSPrivacyAccessedAPICategorySystemBootTime', 117 NSPrivacyAccessedAPITypeReasons: ['35F9.1'], 118 }, 119 { 120 NSPrivacyAccessedAPIType: 121 'NSPrivacyAccessedAPICategoryUserDefaults', 122 NSPrivacyAccessedAPITypeReasons: ['CA92.1', '1C8F.1'], 123 }, 124 ], 125 }, 126 }, 127 androidStatusBar: { 128 barStyle: 'light-content', 129 backgroundColor: '#00000000', 130 }, 131 // Dark nav bar in light mode is better than light nav bar in dark mode 132 androidNavigationBar: { 133 barStyle: 'light-content', 134 backgroundColor: DARK_SPLASH_CONFIG_ANDROID.backgroundColor, 135 }, 136 android: { 137 icon: './assets/icon.png', 138 adaptiveIcon: { 139 foregroundImage: './assets/icon-android-foreground.png', 140 monochromeImage: './assets/icon-android-foreground.png', 141 backgroundImage: './assets/icon-android-background.png', 142 backgroundColor: '#1185FE', 143 }, 144 googleServicesFile: './google-services.json', 145 package: 'xyz.blueskyweb.app', 146 intentFilters: [ 147 { 148 action: 'VIEW', 149 autoVerify: true, 150 data: [ 151 { 152 scheme: 'https', 153 host: 'bsky.app', 154 }, 155 IS_DEV && { 156 scheme: 'http', 157 host: 'localhost:19006', 158 }, 159 ], 160 category: ['BROWSABLE', 'DEFAULT'], 161 }, 162 ], 163 splash: { 164 ...SPLASH_CONFIG_ANDROID, 165 dark: DARK_SPLASH_CONFIG_ANDROID, 166 }, 167 }, 168 web: { 169 favicon: './assets/favicon.png', 170 }, 171 updates: { 172 url: 'https://updates.bsky.app/manifest', 173 enabled: UPDATES_ENABLED, 174 fallbackToCacheTimeout: 30000, 175 codeSigningCertificate: UPDATES_ENABLED 176 ? './code-signing/certificate.pem' 177 : undefined, 178 codeSigningMetadata: UPDATES_ENABLED 179 ? { 180 keyid: 'main', 181 alg: 'rsa-v1_5-sha256', 182 } 183 : undefined, 184 checkAutomatically: 'NEVER', 185 channel: UPDATES_CHANNEL, 186 }, 187 plugins: [ 188 'expo-localization', 189 Boolean(process.env.SENTRY_AUTH_TOKEN) && 'sentry-expo', 190 [ 191 'expo-build-properties', 192 { 193 ios: { 194 deploymentTarget: '15.1', 195 newArchEnabled: false, 196 }, 197 android: { 198 compileSdkVersion: 34, 199 targetSdkVersion: 34, 200 buildToolsVersion: '34.0.0', 201 kotlinVersion: '1.8.0', 202 newArchEnabled: false, 203 }, 204 }, 205 ], 206 [ 207 'expo-notifications', 208 { 209 icon: './assets/icon-android-notification.png', 210 color: '#1185fe', 211 sounds: PLATFORM === 'ios' ? ['assets/dm.aiff'] : ['assets/dm.mp3'], 212 }, 213 ], 214 'expo-video', 215 'react-native-compressor', 216 './plugins/starterPackAppClipExtension/withStarterPackAppClip.js', 217 './plugins/withAndroidManifestPlugin.js', 218 './plugins/withAndroidManifestFCMIconPlugin.js', 219 './plugins/withAndroidStylesWindowBackgroundPlugin.js', 220 './plugins/withAndroidStylesAccentColorPlugin.js', 221 './plugins/withAndroidSplashScreenStatusBarTranslucentPlugin.js', 222 './plugins/shareExtension/withShareExtensions.js', 223 './plugins/notificationsExtension/withNotificationsExtension.js', 224 './plugins/withAppDelegateReferrer.js', 225 ].filter(Boolean), 226 extra: { 227 eas: { 228 build: { 229 experimental: { 230 ios: { 231 appExtensions: [ 232 { 233 targetName: 'Share-with-Bluesky', 234 bundleIdentifier: 'xyz.blueskyweb.app.Share-with-Bluesky', 235 entitlements: { 236 'com.apple.security.application-groups': [ 237 'group.app.bsky', 238 ], 239 }, 240 }, 241 { 242 targetName: 'BlueskyNSE', 243 bundleIdentifier: 'xyz.blueskyweb.app.BlueskyNSE', 244 entitlements: { 245 'com.apple.security.application-groups': [ 246 'group.app.bsky', 247 ], 248 }, 249 }, 250 { 251 targetName: 'BlueskyClip', 252 bundleIdentifier: 'xyz.blueskyweb.app.AppClip', 253 }, 254 ], 255 }, 256 }, 257 }, 258 projectId: '55bd077a-d905-4184-9c7f-94789ba0f302', 259 }, 260 }, 261 hooks: { 262 postPublish: [ 263 /* 264 * @see https://docs.expo.dev/guides/using-sentry/#app-configuration 265 */ 266 { 267 file: 'sentry-expo/upload-sourcemaps', 268 config: { 269 organization: 'blueskyweb', 270 project: 'react-native', 271 release: VERSION, 272 dist: SENTRY_DIST, 273 }, 274 }, 275 ], 276 }, 277 }, 278 } 279}