From 387c6e1b4c9b6f8f4c9ca033552405e294c9e61e Mon Sep 17 00:00:00 2001 From: Keith Kurak Date: Thu, 6 Apr 2023 18:47:08 -0400 Subject: [PATCH] add EAS update --- App.tsx | 6 +++++ android/app/src/main/AndroidManifest.xml | 6 +++++ app.json | 19 +++++++++++-- ios/Expo.plist | 21 +++++++++++++++ .../project.pbxproj | 12 +++++++++ package.json | 1 + yarn.lock | 27 +++++++++++++++++++ 7 files changed, 90 insertions(+), 2 deletions(-) create mode 100644 ios/Expo.plist diff --git a/App.tsx b/App.tsx index bf24c33..9b2f92d 100644 --- a/App.tsx +++ b/App.tsx @@ -16,6 +16,7 @@ import { useColorScheme, View, } from 'react-native'; +import * as Updates from 'expo-updates'; import { Colors, @@ -30,6 +31,10 @@ type SectionProps = PropsWithChildren<{ }>; function Section({children, title}: SectionProps): JSX.Element { + const runTypeMessage = Updates.isEmbeddedLaunch + ? 'This app is running from built-in code' + : 'This app is running an update'; + const isDarkMode = useColorScheme() === 'dark'; return ( @@ -51,6 +56,7 @@ function Section({children, title}: SectionProps): JSX.Element { ]}> {children} + {runTypeMessage} ); } diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index dbadea9..bdc40aa 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,6 +1,12 @@ + + + + + + diff --git a/app.json b/app.json index c24d3fc..814a641 100644 --- a/app.json +++ b/app.json @@ -1,4 +1,19 @@ { "name": "UsingExpoDemo2023", - "displayName": "UsingExpoDemo2023" -} \ No newline at end of file + "displayName": "UsingExpoDemo2023", + "extra": { + "eas": { + "projectId": "fd6f91fb-6a39-44c1-b3ea-ce52135ad12d" + } + }, + "owner": "keith-kurak", + "runtimeVersion": "1.0.0", + "updates": { + "url": "https://u.expo.dev/fd6f91fb-6a39-44c1-b3ea-ce52135ad12d", + "requestHeaders": { + "expo-channel-name": "main" + } + }, + "android": {}, + "ios": {} +} diff --git a/ios/Expo.plist b/ios/Expo.plist new file mode 100644 index 0000000..cd8e32b --- /dev/null +++ b/ios/Expo.plist @@ -0,0 +1,21 @@ + + + + + EXUpdatesCheckOnLaunch + ALWAYS + EXUpdatesEnabled + + EXUpdatesLaunchWaitMs + 0 + EXUpdatesRuntimeVersion + 1.0.0 + EXUpdatesURL + https://u.expo.dev/fd6f91fb-6a39-44c1-b3ea-ce52135ad12d + EXUpdatesRequestHeaders + + expo-channel-name + main + + + \ No newline at end of file diff --git a/ios/UsingExpoDemo2023.xcodeproj/project.pbxproj b/ios/UsingExpoDemo2023.xcodeproj/project.pbxproj index a5a9cea..db2995c 100644 --- a/ios/UsingExpoDemo2023.xcodeproj/project.pbxproj +++ b/ios/UsingExpoDemo2023.xcodeproj/project.pbxproj @@ -12,6 +12,7 @@ 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; + 533FE72829DF807E000611FD /* Expo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 533FE72729DF807E000611FD /* Expo.plist */; }; 7699B88040F8A987B510C191 /* libPods-UsingExpoDemo2023-UsingExpoDemo2023Tests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 19F6CBCC0A4E27FBF8BF4A61 /* libPods-UsingExpoDemo2023-UsingExpoDemo2023Tests.a */; }; 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; CAE24C622AFC4A3C64366DF2 /* ExpoModulesProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5DD85F47B69DE378ACDAA05 /* ExpoModulesProvider.swift */; }; @@ -41,6 +42,7 @@ 19F6CBCC0A4E27FBF8BF4A61 /* libPods-UsingExpoDemo2023-UsingExpoDemo2023Tests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-UsingExpoDemo2023-UsingExpoDemo2023Tests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 3B4392A12AC88292D35C810B /* Pods-UsingExpoDemo2023.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-UsingExpoDemo2023.debug.xcconfig"; path = "Target Support Files/Pods-UsingExpoDemo2023/Pods-UsingExpoDemo2023.debug.xcconfig"; sourceTree = ""; }; 4DDF4DDF38AC340B42991449 /* ExpoModulesProvider.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ExpoModulesProvider.swift; path = "Pods/Target Support Files/Pods-UsingExpoDemo2023-UsingExpoDemo2023Tests/ExpoModulesProvider.swift"; sourceTree = ""; }; + 533FE72729DF807E000611FD /* Expo.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Expo.plist; sourceTree = ""; }; 5709B34CF0A7D63546082F79 /* Pods-UsingExpoDemo2023.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-UsingExpoDemo2023.release.xcconfig"; path = "Target Support Files/Pods-UsingExpoDemo2023/Pods-UsingExpoDemo2023.release.xcconfig"; sourceTree = ""; }; 5B7EB9410499542E8C5724F5 /* Pods-UsingExpoDemo2023-UsingExpoDemo2023Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-UsingExpoDemo2023-UsingExpoDemo2023Tests.debug.xcconfig"; path = "Target Support Files/Pods-UsingExpoDemo2023-UsingExpoDemo2023Tests/Pods-UsingExpoDemo2023-UsingExpoDemo2023Tests.debug.xcconfig"; sourceTree = ""; }; 5DCACB8F33CDC322A6C60F78 /* libPods-UsingExpoDemo2023.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-UsingExpoDemo2023.a"; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -98,6 +100,7 @@ 13B07FAE1A68108700A75B9A /* UsingExpoDemo2023 */ = { isa = PBXGroup; children = ( + 533FE72629DF8068000611FD /* Supporting */, 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 13B07FB01A68108700A75B9A /* AppDelegate.mm */, 13B07FB51A68108700A75B9A /* Images.xcassets */, @@ -127,6 +130,14 @@ name = ExpoModulesProviders; sourceTree = ""; }; + 533FE72629DF8068000611FD /* Supporting */ = { + isa = PBXGroup; + children = ( + 533FE72729DF807E000611FD /* Expo.plist */, + ); + name = Supporting; + sourceTree = ""; + }; 5D127FF1F11C78B519D3035E /* UsingExpoDemo2023Tests */ = { isa = PBXGroup; children = ( @@ -271,6 +282,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 533FE72829DF807E000611FD /* Expo.plist in Resources */, 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */, 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, ); diff --git a/package.json b/package.json index 0136861..b5cd909 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "dependencies": { "expo": "^48.0.0", "expo-dev-client": "~2.1.6", + "expo-updates": "~0.16.4", "react": "18.2.0", "react-native": "0.71.6" }, diff --git a/yarn.lock b/yarn.lock index 276012c..a5d1fbe 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4016,6 +4016,11 @@ expo-dev-menu@2.1.4: expo-dev-menu-interface "1.1.1" semver "^7.3.5" +expo-eas-client@~0.5.0: + version "0.5.1" + resolved "https://registry.yarnpkg.com/expo-eas-client/-/expo-eas-client-0.5.1.tgz#3ef80dbbde13abe35be4e2a2e29b73d2f7fdf27a" + integrity sha512-i3L/iwhI6cFhSUpVsCxSU5qehNznL/rQFYoof6qUIh3CMyijCuTEwjEhwbw2a5W6obPBzQUXbomMSFDO6D5/0Q== + expo-file-system@~15.2.0, expo-file-system@~15.2.2: version "15.2.2" resolved "https://registry.yarnpkg.com/expo-file-system/-/expo-file-system-15.2.2.tgz#a1ddf8aabf794f93888a146c4f5187e2004683a3" @@ -4066,11 +4071,33 @@ expo-modules-core@1.2.6: compare-versions "^3.4.0" invariant "^2.2.4" +expo-structured-headers@~3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/expo-structured-headers/-/expo-structured-headers-3.1.1.tgz#198d44260f4b128d41313ef78df02fa6e20c5054" + integrity sha512-oV6yNGsJxQt7S9HYZTr+4L0I/yRwOF38USJ81I1KiN3GQI4C2z7P5OosyREA2VL9O+kUZVCCpNYsBLSa3/5bAQ== + expo-updates-interface@~0.9.0: version "0.9.1" resolved "https://registry.yarnpkg.com/expo-updates-interface/-/expo-updates-interface-0.9.1.tgz#e81308d551ed5a4c35c8770ac61434f6ca749610" integrity sha512-wk88LLhseQ7LJvxdN7BTKiryyqALxnrvr+lyHK3/prg76Yy0EGi2Q/oE/rtFyyZ1JmQDRbO/5pdX0EE6QqVQXQ== +expo-updates@~0.16.4: + version "0.16.4" + resolved "https://registry.yarnpkg.com/expo-updates/-/expo-updates-0.16.4.tgz#6d05438cf7304add03645a598211ac4ef3cc4f64" + integrity sha512-hEUotP10sBiYn6dvkYC2rIa+kAmsBuaMp32sIVNAYEwKMQJqEwqNAKTU6CpJ4Aoc//BYL2Hv8qNo/UsT4rATRg== + dependencies: + "@expo/code-signing-certificates" "0.0.5" + "@expo/config" "~8.0.0" + "@expo/config-plugins" "~6.0.0" + "@expo/metro-config" "~0.7.0" + arg "4.1.0" + expo-eas-client "~0.5.0" + expo-manifests "~0.5.0" + expo-structured-headers "~3.1.0" + expo-updates-interface "~0.9.0" + fbemitter "^3.0.0" + resolve-from "^5.0.0" + expo@^48.0.0: version "48.0.10" resolved "https://registry.yarnpkg.com/expo/-/expo-48.0.10.tgz#c1218f6a0ca9ca8209d6f833dc6911743870dfaf"