How to detect when App exits but not closes?

On IOS and Android, when running an app, the user can press a home button or something similar anytime. Usually you will need to save your game data during this time because the OS at any point could kill your app after this, and you will need a way to restore it. Where is this event in Unity?

On iOS, you are probably looking for the OnApplicationPause() callback. You might also take a look at OnApplicationQuit() (and note the information about iOS in this entry).