- Home /
Mobile: Detecting when the application is put into the background. Not OnApplicationPause, OnApplicationFocus
I know that the application can detect when it is paused through OnApplicationPause, or OnApplicationFocus. These would work fine for my situation since I do need the game to perform an action when the player puts the app into the background. Except that OnApplicationPause is also triggered by the player locking their phone using the power button.
I do not want the game to trigger the action when the player locks their phone, so I can't use the above-mentioned methods, are there any other ways to detect when the app is paused? Or maybe a way to filter out what triggered the pause of the app? I'm hoping for a solution that would work for Android and iOS.
Any help would be appreciated, thanks for spending your time to read this.
Answer by Orion_78 · Apr 24, 2020 at 08:47 AM
You might receive the power button input as well and perform action if it is trigger just before/after OnApplicationPause()
Your answer
Follow this Question
Related Questions
Display Activity indicator center 0 Answers
big terrain performance && mobile 1 Answer
C++ windows DLL and Android? 1 Answer
I'm looking for help with enemy AI scripting and animations. 1 Answer