about summary refs log tree commit diff
path: root/app.config.js
diff options
context:
space:
mode:
authorHailey <me@haileyok.com>2024-04-12 14:51:53 -0700
committerGitHub <noreply@github.com>2024-04-12 14:51:53 -0700
commitf91aa37c6bd900bdc4eec1095c9ecd83da2f13f2 (patch)
treeadf306037f951e0d18500fa928de999794c6a863 /app.config.js
parent1f587ea4b66a6680d8d1fe06b1705994165973d5 (diff)
downloadvoidsky-f91aa37c6bd900bdc4eec1095c9ecd83da2f13f2.tar.zst
Enable updates for `production` behind `receive_updates` gate (#3496)
* add gate type

* gate the updates

* enable updates in `production`

* web placeholder for `useOTAUpdates()`

* update comment
Diffstat (limited to 'app.config.js')
-rw-r--r--app.config.js16
1 files changed, 10 insertions, 6 deletions
diff --git a/app.config.js b/app.config.js
index 9036d5e33..40feed40c 100644
--- a/app.config.js
+++ b/app.config.js
@@ -42,8 +42,14 @@ module.exports = function (config) {
 
   const IS_DEV = process.env.EXPO_PUBLIC_ENV === 'development'
   const IS_TESTFLIGHT = process.env.EXPO_PUBLIC_ENV === 'testflight'
+  const IS_PRODUCTION = process.env.EXPO_PUBLIC_ENV === 'production'
 
-  const UPDATES_CHANNEL = IS_TESTFLIGHT ? 'testflight' : 'production'
+  const UPDATES_CHANNEL = IS_TESTFLIGHT
+    ? 'testflight'
+    : IS_PRODUCTION
+    ? 'production'
+    : undefined
+  const UPDATES_ENABLED = !!UPDATES_CHANNEL
 
   return {
     expo: {
@@ -126,14 +132,12 @@ module.exports = function (config) {
       },
       updates: {
         url: 'https://updates.bsky.app/manifest',
-        // TODO Eventually we want to enable this for all environments, but for now it will only be used for
-        // TestFlight builds
-        enabled: IS_TESTFLIGHT,
+        enabled: UPDATES_ENABLED,
         fallbackToCacheTimeout: 30000,
-        codeSigningCertificate: IS_TESTFLIGHT
+        codeSigningCertificate: UPDATES_ENABLED
           ? './code-signing/certificate.pem'
           : undefined,
-        codeSigningMetadata: IS_TESTFLIGHT
+        codeSigningMetadata: UPDATES_ENABLED
           ? {
               keyid: 'main',
               alg: 'rsa-v1_5-sha256',