Call SaveGame() when application loses focus?

I’m working on a mobile Incremental game like cookie clicker. I have a function called SaveGame() in my gamemanger singleton object. The SaveGame() Method works fine when called from a test button. What I need to do is Call this method whenever the application loses focus. For instance, the game needs to save if the user returns home, without hitting the android escape key, or if they leave the app via clining on a text. Basically whenever it loses focus to protect the user from closing the game before it can save.

void OnApplicationFocus(bool focusStatus)
    {

        if (focusStatus == false)
        {
            GameManager.Instance.Save();
        }
    }

This does not seem to be working.

void OnApplicationFocus(bool focusStatus)
{

         if (focusStatus == false)
         {
             GameManager.Instance.Save();
         }
     }

Does work, Unity 5.4 just needed a restart I suppose.

You might try OnApplicationPause

The Best Answer is in this video: