- Home /
OnApplicationPause() not called on Windows Store when suspending
I am developing a game for Windows Phone and Windows Store. When the game is suspended (that is, it is no longer in the foreground) I need to save the game state (current level, scores, etc.). To do that, I define the OnApplicationPause() function on a game object on which I called DontDestroyOnLoad(). OnApplicationPause(false) is called at startup on both Windows Store and Windows Phone. When the game is suspended (goes to the background), OnApplicationPause(true) is called on Windows Phone, but it is NOT called on Windows Store. - Is this behavior expected? - How can I correctly detect that the game is suspended on Windows Store?
I am using Windows Store 8.1 and Windows Phone 8.1.
Answer by carlo68 · Jul 03, 2015 at 05:07 PM
I finally found the reason for this: the Player settings had the "Run in Background" flag set to true. This was causing this behavior. With "Run in Background" set to false, OnApplicationPause(true) is called.
Your answer
Follow this Question
Related Questions
Metro App, no graphics refresh after resume 0 Answers
Unity Android Suspend/Resume and Quit behaviour 1 Answer
iAd Suspend Resume 1 Answer