Search Unity

Failed to use play service save game

Discussion in 'Android' started by neozmin, Aug 18, 2018.

  1. neozmin

    neozmin

    Joined:
    Jun 15, 2018
    Posts:
    10
    I am struggling with problem that saved games in googl play services aren't event started!

    The code:

    Code (CSharp):
    1. PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()
    2.             .RequestServerAuthCode(false)
    3.             .EnableSavedGames()
    4.             .Build();
    5.  
    6.         PlayGamesPlatform.InitializeInstance(config);
    7.         PlayGamesPlatform.DebugLogEnabled = true;
    8.         PlayGamesPlatform.Activate();
    Than, on button clicked:

    Code (CSharp):
    1. Social.localUser.Authenticate(HandleConnected);
    HandleConnected:

    Code (CSharp):
    1.  public void ShowSaveSystemUI(ILocalUser user, Action<SelectUIStatus, ISavedGameMetadata> callback)
    2.     {
    3.         uint maxNumToDisplay = 3;
    4.         bool allowCreateNew = true;
    5.         bool allowDelete = true;
    6.  
    7.         ISavedGameClient savedGameClient = PlayGamesPlatform.Instance.SavedGame;
    8.  
    9.         if (savedGameClient != null)
    10.         {
    11.             savedGameClient.ShowSelectSavedGameUI(user.userName + "\u0027s saves",
    12.                                                   maxNumToDisplay,
    13.                                                   allowCreateNew,
    14.                                                   allowDelete,
    15.             (SelectUIStatus status, ISavedGameMetadata saveGame) =>
    16.             {
    17.                  // some error occured, just show window again
    18.                  if (status != SelectUIStatus.SavedGameSelected)
    19.                 {
    20.                     ShowSaveSystemUI(user, callback);
    21.                     return;
    22.                 }
    23.  
    24.                 if (callback != null)
    25.                     callback.Invoke(status, saveGame);
    26.  
    27.                 if (OnSaveGameSelected != null && status == SelectUIStatus.SavedGameSelected)
    28.                     OnSaveGameSelected.Invoke();
    29.             });
    30.  
    31.         }
    32.         else
    33.         {
    34.             // this is usually due to incorrect APP ID
    35.             Debug.LogError("Save Game client is null...");
    36.         }
    37.     }
    And i am always getting this error:

    Code (CSharp):
    1. 08-18 23:43:04.451: E/Unity(30152): NotImplementedException: You must enable saved games before it can be used. See PlayGamesClientConfiguration.Builder.EnableSavedGames.
    2.  
    Authorization is successfully proceeded. Console settings includes saved games and they are switched on. What should i do?