Hello everyone,
I am trying to save some data in the google play user account by using the GooglePlayGames package (found here).
I can sign in correctly the user with the following code :
PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().EnableSavedGames().Build();
PlayGamesPlatform.InitializeInstance(config);
PlayGamesPlatform.DebugLogEnabled = true;
PlayGamesPlatform.Activate();
PlayGamesPlatform.Instance.Authenticate(success =>
{
LoadData();
});
Then the LoadData method is called :
//used for loading data from the cloud or locally
void LoadData()
{
Debug.Log("LoadData");
//basically if we're connected to the internet, do everything on the cloud
if (PlayGamesPlatform.Instance.IsAuthenticated() /*Social.localUser.authenticated*/)
{
Debug.Log("authenticated");
isSaving = false;
((PlayGamesPlatform)Social.Active).SavedGame.OpenWithManualConflictResolution(SAVE_NAME,
DataSource.ReadCacheOrNetwork, true, ResolveConflict, OnSavedGameOpened);
Debug.Log("OpenWithManualConflictResolution over");
}
//this will basically only run in Unity Editor, as on device,
//localUser will be authenticated even if he's not connected to the internet (if the player is using GPG)
else
{
Debug.Log("not authenticated");
LoadLocal();
}
}
The issue seems to be located here :
((PlayGamesPlatform)Social.Active).SavedGame.OpenWithManualConflictResolution(SAVE_NAME,
DataSource.ReadCacheOrNetwork, true, ResolveConflict, OnSavedGameOpened);
I get a very ugly error :
“[Exception] : NotImplementedException: You must enable saved games before it can be used. See PlayGamesClientConfiguration.Builder.EnableSavedGames.”
This exception is lanched by the code contained in NativeClient.cs from the same package :
if (mConfiguration.EnableSavedGames)
{
mSavedGameClient =
new NativeSavedGameClient(new SnapshotManager(mServices));
}
else
{
mSavedGameClient = new UnsupportedSavedGamesClient("You must enable saved games before it can be used. " + "See PlayGamesClientConfiguration.Builder.EnableSavedGames.");
}
My builder contains the “EnableSavedGames” call, and in the google play console I already activated the saved games in my game service.
I do not know if this problem is related to the fact that I test my code in an internal version, and that I linked the game service to the published game before these modifications (I do not think this works like that, because I can sign in and check the leaderboards …)
If anyone has an idea, It’ll be welcome, I’m stuck on that since a long time now …