Hello I am trying to follow the documentation onApplicationQuit. For iOS it says “. For iOS builds, enable the “Exit on Suspend” property in Player Settings” when I was looking on other forums I found this image from a user showing the setting. When looking through my player setting I cannot find this setting in my player preferences after looking at more documentation is the setting different?
Images:
Found on a previous forum (2015):
My Current Project Settings (Unity 2019.4.17f1 in 2020)
“Exit on Suspend” was deprecated by apple, so it is either suspend or “custom” background mode
we have also changed the way we handle background modes, now there is a special enum
also it was moved in player settings.
I will see into updating the docs
I’m trying to track when the game is closed. OnApplicationQuit is called if I try with Unity Editor but that doesn’t happen with the iOS release. I only checked “Enable Custom Background behaviors”. Do I have to check another option? Or what else must I do?
@Alexey I have a question, you said “it is either suspend or “custom” background mode”, so how the OnApplicationPause() method is working currently? Please let me know.
in short: we check the background processing, if it is suspend, we run one more player loop (so your scripts actually get OnApplicationPause message) and then suspend; and if there is some background mode, you are not paused “technically”, so we pretend nothing have happened (note, you will get “focus lost” in both cases)