OTA Update on Appstate change to foreground

Please provide the following:

  1. SDK Version: 47
  2. Platforms(Android/iOS/web/all): iOS
  3. Add the appropriate “Tag” based on what Expo library you have a question on.

For various reasons, I don’t want to force full app reloads in order to load new EAS updates. Most of the time, I can safely load a new version when the app is brought back to the foreground. Specifically, if an update is available, I want to load a new version upon mounting of my main component, as well as when it’s brought to the foreground.

It’s not at all clear to me how to do this based on the documentation. I’m guessing I can use useUpdateEvents to set a variable marking that an update is ready and then call reloadAsync upon returning to the foreground. But not sure how to handle the update on mount. Ie, if an update is available, does that effect fire an event on mount?

Or would it make more sense to check for updates when returning from the foreground - though I’m uncertain how to do this.

Generally, is there a canonical way of updating upon returning to the foreground, as well as when the component first mounts?

As an aside, it strikes me as odd that the default behavior of loading a new OTA update is dependent on a full app reload, since force quitting and restarting the app is a pretty uncommon user behavior. Any insights into this as well?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.