11import type { ExpoConfig } from "expo/config" ;
22
33import { loadRepoEnv } from "../../scripts/lib/public-config.ts" ;
4-
5- type AppVariant = "development" | "preview" | "production" ;
4+ import { APP_VARIANT_CONFIG , resolveAppVariant } from "./app-variants.ts" ;
65
76const repoEnv = loadRepoEnv ( ) ;
87Object . assign ( process . env , repoEnv ) ;
2322 ) ;
2423}
2524
26- const VARIANT_CONFIG : Record <
27- AppVariant ,
28- {
29- readonly appName : string ;
30- readonly scheme : string ;
31- readonly iosIcon : string ;
32- readonly splashIcon : string ;
33- readonly iosBundleIdentifier : string ;
34- readonly androidPackage : string ;
35- readonly relyingParty ?: string ;
36- }
37- > = {
38- development : {
39- appName : "T3 Code Dev" ,
40- scheme : "t3code-dev" ,
41- iosIcon : "./assets/icon-composer-dev.icon" ,
42- splashIcon : "./assets/splash-icon-dev.png" ,
43- iosBundleIdentifier : "com.t3tools.t3code.dev" ,
44- androidPackage : "com.t3tools.t3code.dev" ,
45- relyingParty : "clerk.t3.codes" ,
46- } ,
47- preview : {
48- appName : "T3 Code Preview" ,
49- scheme : "t3code-preview" ,
50- iosIcon : "./assets/icon-composer-prod.icon" ,
51- splashIcon : "./assets/splash-icon-prod.png" ,
52- iosBundleIdentifier : "com.t3tools.t3code.preview" ,
53- androidPackage : "com.t3tools.t3code.preview" ,
54- relyingParty : "clerk.t3.codes" ,
55- } ,
56- production : {
57- appName : "T3 Code" ,
58- scheme : "t3code" ,
59- iosIcon : "./assets/icon-composer-prod.icon" ,
60- splashIcon : "./assets/splash-icon-prod.png" ,
61- iosBundleIdentifier : "com.t3tools.t3code" ,
62- androidPackage : "com.t3tools.t3code" ,
63- relyingParty : "clerk.t3.codes" ,
64- } ,
65- } ;
66-
67- function resolveAppVariant ( value : string | undefined ) : AppVariant {
68- switch ( value ) {
69- case "development" :
70- case "preview" :
71- case "production" :
72- return value ;
73- default :
74- return "production" ;
75- }
76- }
77-
78- const variant = VARIANT_CONFIG [ APP_VARIANT ] ;
25+ const variant = APP_VARIANT_CONFIG [ APP_VARIANT ] ;
7926
8027const dmSansFonts = {
8128 regular : "@expo-google-fonts/dm-sans/400Regular/DMSans_400Regular.ttf" ,
@@ -121,7 +68,7 @@ const config: ExpoConfig = {
12168 policy : process . env . MOBILE_VERSION_POLICY ?? "fingerprint" ,
12269 } ,
12370 orientation : "portrait" ,
124- icon : "./ assets/icon.png" ,
71+ icon : variant . assets . appIcon ,
12572 userInterfaceStyle : "automatic" ,
12673 updates : {
12774 enabled : true ,
@@ -130,7 +77,7 @@ const config: ExpoConfig = {
13077 fallbackToCacheTimeout : 0 ,
13178 } ,
13279 ios : {
133- icon : variant . iosIcon ,
80+ icon : variant . assets . iosIcon ,
13481 supportsTablet : true ,
13582 bundleIdentifier : variant . iosBundleIdentifier ,
13683 // Pin code signing to the T3 Tools team so non-interactive `expo run:ios`
@@ -151,21 +98,20 @@ const config: ExpoConfig = {
15198 } ,
15299 } ,
153100 android : {
154- icon : "./ assets/icon.png" ,
101+ icon : variant . assets . appIcon ,
155102 package : variant . androidPackage ,
156103 adaptiveIcon : {
157- backgroundColor : "#E6F4FE" ,
158- foregroundImage : "./assets/android-icon-foreground.png" ,
159- backgroundImage : "./assets/android-icon-background.png" ,
160- monochromeImage : "./assets/android-icon-monochrome.png" ,
104+ backgroundColor : variant . assets . androidAdaptiveBackgroundColor ,
105+ foregroundImage : variant . assets . androidAdaptiveForeground ,
106+ monochromeImage : variant . assets . androidMonochromeIcon ,
161107 } ,
162108 // Opts into OnBackInvokedCallback-based back dispatch (Android 13+).
163109 // JS back handling survives it via react-native's Android 16 shim plus
164110 // withAndroidPredictiveBackCompat on Android 13-15.
165111 predictiveBackGestureEnabled : true ,
166112 } ,
167113 web : {
168- favicon : "./ assets/favicon.png" ,
114+ favicon : variant . assets . appIcon ,
169115 } ,
170116 plugins : [
171117 "expo-asset" ,
@@ -195,6 +141,14 @@ const config: ExpoConfig = {
195141 ] ,
196142 "expo-secure-store" ,
197143 "expo-sqlite" ,
144+ [
145+ "expo-notifications" ,
146+ {
147+ icon : variant . assets . androidNotificationIcon ,
148+ color : variant . assets . androidNotificationColor ,
149+ mode : APP_VARIANT === "development" ? "development" : "production" ,
150+ } ,
151+ ] ,
198152 // appleSignIn must be gated here: withoutIosPersonalTeamCapabilities.cjs runs before
199153 // plugins earlier in this array, so it cannot strip the entitlement Clerk would add.
200154 [ "@clerk/expo" , { theme : "./clerk-theme.json" , appleSignIn : ! isIosPersonalTeamBuild } ] ,
@@ -206,8 +160,8 @@ const config: ExpoConfig = {
206160 // the shortcut items set in src/features/shortcuts.
207161 androidIcons : {
208162 shortcut_icon : {
209- foregroundImage : "./ assets/android-icon-foreground.png" ,
210- backgroundColor : "#E6F4FE" ,
163+ foregroundImage : variant . assets . androidAdaptiveForeground ,
164+ backgroundColor : variant . assets . androidAdaptiveBackgroundColor ,
211165 } ,
212166 } ,
213167 } ,
@@ -217,17 +171,18 @@ const config: ExpoConfig = {
217171 {
218172 cameraPermission : "Allow T3 Code to access your camera so you can scan pairing QR codes." ,
219173 barcodeScannerEnabled : true ,
174+ recordAudioAndroid : false ,
220175 } ,
221176 ] ,
222177 [
223178 "expo-splash-screen" ,
224179 {
225- image : variant . splashIcon ,
180+ image : variant . assets . splashIcon ,
226181 resizeMode : "contain" ,
227182 backgroundColor : "#ffffff" ,
228183 imageWidth : 220 ,
229184 dark : {
230- image : variant . splashIcon ,
185+ image : variant . assets . splashIcon ,
231186 backgroundColor : "#0a0a0a" ,
232187 } ,
233188 } ,
0 commit comments