- Home /
Question by
Luiz_Thiago · Mar 05, 2015 at 03:47 PM ·
iossave
Save game in iOS background
It is possible to call the Save method, when the game comes in the background on iOS? If it is possible, how?
Comment
When the app goes to background, OnApplicationPause is called. Here you can find more details about it(OnApplicationPause). It have a bool parameter that is true when the goes to background and is false when the app returns to foreground. Your code should look like this:
void OnApplicationPause(bool pause) {
if(pause) {
//save here.
}
}
Your answer
![](https://koobas.hobune.stream/wayback/20220613185133im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
how can i take a screenshot (by UiButton) and save it in CameraRoll (Gallery in iOS)? 0 Answers
iOS: Where to store DLC away from iCloud? 1 Answer
iOS PlayerPrefs issue, Working on Desktop Not on iOS device (5.1) 0 Answers
Lowest common denominator of saving game information 0 Answers
XmlException when trying to read/write XML from iOS device 1 Answer