custom-expo-updates-server
custom-expo-updates-server copied to clipboard
Using together with Expo Updates package seems to be not working
So far I didn't have success using this project to serve updates to my App.
I'm using Expo Updates package, the App.tsx looks like this:
import * as Updates from 'expo-updates';
export default function App() {
useEffect(() => {
async function updateApp() {
mixpanel.track('UpdateApp - Checkin for new Update');
const { isAvailable } = await Updates.checkForUpdateAsync();
mixpanel.track(
'UpdateApp: ' + (isAvailable ? 'Available' : 'Not Available')
);
if (isAvailable) {
await Updates.fetchUpdateAsync();
await Updates.reloadAsync();
mixpanel.track('UpdateApp: fetchUpdateAsync and reloadAsync executed');
}
}
// updateApp();
}, []);
...
}
The project is up and running on a server, behind an SSL certificate and so on, and the response of the manifest endpoint is something like this:
-------ExpoManifestBoundary-536e836354679f3f82fc
Content-Disposition: form-data; name="manifest"
Content-Type: application/json
{"id":"b1230cef-2e0c-556e-d285-07e11af8567c","createdAt":"2024-04-17T14:49:11.335Z","runtimeVersion":"1.1.1","assets":[{"hash":"hcWa-O41K4MW3pSPRhk3SaL0hMxx6OHbI_8q2K-W7h4","key":"beb6203138487da728da4ef2cb9e4105","fileExtension":".ttf","contentType":"font/ttf","url":"<CDN_URL>.
...
-------ExpoManifestBoundary-536e836354679f3f82fc--
I was checking the Tech Specs https://docs.expo.dev/technical-specs/expo-updates-1/, the response seems to be fine but the app doesn't update. I guess it could be something with Expo Update package. When using it behind a proxy (eg. Charles) I can see that the request is made to the Manifest, but after that nothing happens.
Has anyone made it work so far? I'm not sure what could be wrong. If anyone could give some light, I would appreciate it.
Rgds,
if (isAvailable) { await Updates.fetchUpdateAsync(); await Updates.reloadAsync(); mixpanel.track('UpdateApp: fetchUpdateAsync and reloadAsync executed'); } Are there any errors thrown in the fetchUpdateAsync() and if yes, what kind of? Also try to add debugging in the native code and check if this runs successfully: node_modules/expo-updates/ios/EXUpdates/AppLoader/FileDownloader.swift -> parseMultipartManifestResponse()