Skip to content

Commit

Permalink
Make separate app identifiers and names based on release channel
Browse files Browse the repository at this point in the history
This makes it easier for development
  • Loading branch information
jsubloom committed Sep 8, 2023
1 parent 913daf9 commit ab35e9f
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 7 deletions.
49 changes: 45 additions & 4 deletions packages/mobile/app.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const releaseChannel = process.env.RELEASE_CHANNEL?.toLowerCase();

export default {
name: "bloom-reader-lite-mobile",
slug: "bloom-reader-lite-mobile",
name: getAppName(),
slug: "bloom-reader-lite-mobile", // Used in Expo URLs or the project name in Expo Go, I think. I don't think it needs to vary based on release channel.
version: "1.0.0",
orientation: "portrait",
icon: "./assets/BloomIcon.png",
Expand All @@ -13,10 +15,11 @@ export default {
assetBundlePatterns: ["**/*"],
ios: {
supportsTablet: true,
bundleIdentifier: "org.sil.bloomreaderlite",
bundleIdentifier: getPackageIdentifier(),
},
android: {
package: "org.sil.bloomreaderlite",
package: getPackageIdentifier(),
// ENHANCE: Create the adaptive icon. See instructions here: https://docs.expo.dev/develop/user-interface/app-icons/#android. It's not hard.
// "adaptiveIcon": {
// "foregroundImage": "./assets/adaptive-icon.png",
// "backgroundColor": "#ffffff"
Expand All @@ -34,3 +37,41 @@ export default {
tsconfigPaths: true,
},
};

function getAppName() {
const baseAppName = "Bloom Reader Lite";
switch (releaseChannel) {
case "development":
return `${baseAppName} (Dev)`;
case "alpha":
return `${baseAppName} (Alpha)`;
case "beta":
return `${baseAppName} (Beta)`;
case "release":
case undefined:
return baseAppName;
default:
console.warn("Unknown releaseChannel " + releaseChannel);
return baseAppName;
}
}

// Returns the "bundleIdentifier" (iOS) or "package" identifier (Android)
// It's handy to have separate ones for
// Wait, for submitting to the app stores... don't we want them to all be under basePackageIdentifier?
// Well, as long as "eas submit" doesn't set the env variable, I think it'd work ok.
function getPackageIdentifier() {
const basePackageIdentifier = "org.sil.bloomreaderlite";
switch (releaseChannel) {
case "development":
case "alpha":
case "beta":
return `${basePackageIdentifier}.${releaseChannel}`;
case "release":
case undefined:
return basePackageIdentifier;
default:
console.warn("Unknown releaseChannel " + releaseChannel);
return basePackageIdentifier;
}
}
15 changes: 12 additions & 3 deletions packages/mobile/eas.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,25 @@
"developer": {
"developmentClient": true,
"distribution": "internal",
"channel": "alpha"
"channel": "developer",
"env": {
"RELEASE_CHANNEL": "developer"
}
},
"alpha": {
// Intended for "internal distribution" (iOS) or "internal test" (Android)
"distribution": "internal",
"channel": "alpha"
"channel": "alpha",
"env": {
"RELEASE_CHANNEL": "alpha"
}
},
"beta": {
// Intended for "TestFlight" (iOS) or "Open test" (Android) (or "Closed test" is probably fine too)
"channel": "beta"
"channel": "beta",
"env": {
"RELEASE_CHANNEL": "beta"
}
},
"release": {
"channel": "release"
Expand Down

0 comments on commit ab35e9f

Please sign in to comment.