Event after coming back from background

Hi,
I made a plugin calling every 15 minutes a JSON URL - what is working fine.

If I send the app in background (as sample while checking something else on tablet) and when it is coming back - all data in elements are missing. This maybe ok by design, because data could be outdated…

Is there any event for “activation” of the app (come in foreground again) - so that it could be used for an immediate call of poll process again? Or maybe an event that a page is coming active?
Or can the “old” data be cached?

I recently ran into the same problem of losing data when minimized. I discovered that onConnect is called when the window is restored and I kept a variable counting each time onConnect was called.

If my variable was >1 then the data was restored and everything works good.

Just wondered if you ever came across a fix or found a way to keep the program from going Suspended when minimized. I have some timer functions I would like to keep working even when the program loses focus.

Jerry

When the app is moved to the background it fires “onDisconnect” & when it comes back it’ll fire “onConnect”.

It seemed that in the onDisconnect function that I couldn’t get a snapshot of device values. I didn’t really spend much time trying to make it work as saving values as they were changed worked well.