Do OTA updates in Expo get in motion on the first

2020-07-10 09:52发布

问题:

I developed an app with React Native and distributed it with Expo. I published the final version into Google Play and Apple Store.

Some time later I discovered in Expo's docs on Publishing that expo publish allows you to create an OTA ("over the air") update that is built into Expo and updates the app automatically, according to this answer:

The standalone app knows to look for updates at your app's published url.

This I tested and worked very well.

However, now I see that people downloading the app from the stores (that is, either Google Play or Apple Store) apparently get the initial version of the app, not the updated one.

What is the exact workflow for the OTA updates? Do they go and "replace" the existing version in Google Play and Apple Store the first time they open it? Or do they need to open it over again to get the update?

And what exactly triggers the update of the app?

回答1:

We've been having similar problems. I can see two things which might be causing this in your case:

  • Check in app.json if updates.fallbackToCacheTimeout is set. If it's set, that's how long expo will try to download the latest update before showing the last downloaded version (which will be the initial version after initial download).
  • If you have a large update, expo will try downloading the update for 30s before showing the last version of your app.

Check here for more info: https://docs.expo.io/versions/latest/guides/configuring-ota-updates/

OTA updates do not replace the version downloaded from the app store, they are stored first in the device's cache before being run on app start after download. Source https://docs.expo.io/versions/latest/sdk/updates/

Update downloads are automatically triggered on app start, then, depending on the settings it will either wait (as long as updates.fallbackToCacheTimeout allows) before showing the app, or show it immediately.

You can force the app to run the latest update (if you have one waiting) by just force quitting the app, then restarting.

Hope this helps!