Search Unity

Question Cloud Save on Android

Discussion in 'Cloud Save' started by TheEugeneL, Sep 7, 2022.

  1. TheEugeneL

    TheEugeneL

    Joined:
    Dec 7, 2017
    Posts:
    43
    Hello,

    On iOS, I only send saves when the player minimizes the game, and it works perfectly.

    Code (CSharp):
    1. void OnApplicationPause(bool pauseStatus)
    2.     {
    3.         if (pauseStatus)
    4.         {
    5.             //Save Player Data
    6.             await SaveData.ForceSaveAsync(CachedData);
    7.         }
    8.     }
    On Android, if the player minimizes the game with a swipe, it also works. But if the player minimized the game with the Home button, it does not work and data is sent only if the player returned to the game.

    Perhaps there is some way to do this?
     
  2. MileyUnity

    MileyUnity

    Joined:
    Jan 3, 2020
    Posts:
    92
    Hi there, this would be better to ask in the Android part of the forums as it's not really about CloudSave but rather detecting the home button minimization on Android :)
     
  3. TheEugeneL

    TheEugeneL

    Joined:
    Dec 7, 2017
    Posts:
    43
    Hi! Ok, thanks!
    I just thought that maybe some of the developers here could have a similar experience.