Appflow, Live Update using background update method. When the update happens?

I can’t make it work, but probably because my understanding of how it supposed to work is wrong. So asking for clarification.

The only place describing the “background” update method that I found is Install the Live Update SDK. Quoting (it is short enough)

background (Recommended) - The app will check for updates in the background and not prolong the amount of time the splash screen is shown. If an update is available it will be downloaded and installed while the user is using the older version. The next time they launch the app or the app has been in background for the duration specified my min-background-duration the new version will be loaded.

My understanding of it is this. There are these three events.

  1. The plugin checks for updates and finds there is a new update in teh channel
  2. The plugin downloads the update and installs it
  3. The plugin loads the update.

Event #2 -download - happens right after #1 if there was an update
Event #3 - loading - happens either upon launch or after min-background-duration seconds.

What is not clear is when Event #1, check for update, happens. It happens in the background, but when? is it when the app goes into the background? Is it at random times? Is it by push notifcaiton from the channel whenever the new web build is deployed to the channel?

Lets say I set ionic_min_background_duration strings.xml value to 1 (not sure if I am allowed to set to 0).

  • I build an android native build using appflow, with Production for a channel. I installed the app. I switch to another app, mine goes into background. Call it moment #1.
  • I build a web app with a modified string, I deploy it to the channel. It is moment #2.

How long should I wait from the moment #2, so that switching to the app (making it go to the foreground) will make the update load?

So far whatever I did failed. The only way to get the update was - uninstall the android app. Install it again. When it runs the first time it installs the update from the channel.

1 Like