Compare commits

..
4 changed files with 72 additions and 0 deletions

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
# Mobile build variants
EAS profiles set `APP_VARIANT` to select the app identity in `app.config.ts`.
Both iOS bundle identifiers and Android package names use these values:
| Profile | App name | Identifier |
| --- | --- | --- |
| development | oTunes (Development) | com.abunchofknowitalls.otunes.development |
| preview | oTunes (Preview) | com.abunchofknowitalls.otunes.preview |
| production | oTunes | com.abunchofknowitalls.otunes |
Build with `eas build --profile development`, `--profile preview`, or
`--profile production` from this directory.
For local builds and Metro, select the same variant explicitly:
```sh
APP_VARIANT=development pnpm ios
APP_VARIANT=development pnpm android
APP_VARIANT=development pnpm start
```
An unset `APP_VARIANT` keeps the production identity. Unknown variants fail
configuration. URL schemes are `otunes-development`, `otunes-preview`, and
`otunes` respectively, allowing the apps to be installed together.
+31
View File
@@ -0,0 +1,31 @@
import type { ConfigContext, ExpoConfig } from "expo/config"
export default ({ config }: ConfigContext): ExpoConfig => {
const variant = process.env.APP_VARIANT ?? "production"
if (!["development", "preview", "production"].includes(variant)) {
throw new Error(`Unsupported APP_VARIANT: ${variant}`)
}
const suffix = variant === "production" ? "" : `.${variant}`
const nameSuffix =
variant === "development"
? " (Development)"
: variant === "preview"
? " (Preview)"
: ""
return {
...config,
name: `${config.name}${nameSuffix}`,
slug: config.slug!,
scheme: variant === "production" ? "otunes" : `otunes-${variant}`,
ios: {
...config.ios,
bundleIdentifier: `${config.ios!.bundleIdentifier}${suffix}`,
},
android: {
...config.android,
package: `${config.android!.package}${suffix}`,
},
}
}
+9
View File
@@ -5,13 +5,22 @@
},
"build": {
"development": {
"env": {
"APP_VARIANT": "development"
},
"developmentClient": true,
"distribution": "internal"
},
"preview": {
"env": {
"APP_VARIANT": "preview"
},
"distribution": "internal"
},
"production": {
"env": {
"APP_VARIANT": "production"
},
"autoIncrement": true
}
},
+7
View File
@@ -38,6 +38,13 @@ export function useAppNavigation() {
const router = useRouter()
const push = useCallback((path: string) => {
if (activeSegmentsRef.current.includes("player")) {
// Leave the root player modal before navigating into the library stack.
router.dismiss()
router.navigate(tabPath("library", path))
return
}
router.push(tabPath(getActiveTabFromRef(), path))
}, [router])