How to detect app has been suspended?

Hi,
So I have an app that pulls data from my web server, and this content updates daily…

The issue I’m having is that I want to add the ability for the app to run in the background without being suspended, however I don’t know of a means of essentially doing an “OnAppResumed” function.

I was just wondering if anyone knew of a way of either detecting the app has been re opened? Or alternatively detecting if the home button has been pressed?

Thanks!

  • Adam G

OnApplicationPause is being called when its put into back or foreground.

Apps don’t run in the background, you don’t have the “luxury” of run in background without being suspended for unity applications in general. Only music players, voip and location tracking might do that and only if they specified the required flag in the plist. This normally requires native code as the unity engine is quite too heavy for background processes

Ahh awesome, that’s all I needed thanks dude!

Just needed some way of identifying the thing had been closed/ new data needed to be pulled :)!