play-games-plugin-for-unity icon indicating copy to clipboard operation
play-games-plugin-for-unity copied to clipboard

After successfully ReportScore, method LoadScores return null PlayerScore

Open steam3d opened this issue 1 year ago • 0 comments

First I successful login in Google Play games:

PlayGamesPlatform.Instance.Authenticate(ProcessAuthentication);

internal void ProcessAuthentication(SignInStatus status)
{
	signInStatus = status;

	if (signInStatus == SignInStatus.Success) // Calback return Success
	{
		SynchronizeUserScore();
		OnAuthStateChanged?.Invoke();
	}
}

I try to save a score to Google Play games:

PlayGamesPlatform.Instance.ReportScore(score, LEADERBOARD_SCORES, async isReported =>
{

	Debug.Log($"Report score return {isReported}"); // Calback return true
}

Then I try to load the saved score:

PlayGamesPlatform.Instance.LoadScores(
leaderboardId: LEADERBOARD_SCORES,
start: LeaderboardStart.PlayerCentered, 
rowCount: 1,
collection: LeaderboardCollection.Public,
timeSpan: LeaderboardTimeSpan.AllTime,
callback: data =>
{
	Debug.Log($"Valid: {data.Valid}"); // Always true
	Debug.Log($"PlayerScore: {data.PlayerScore}"); // Always null
});

I could not get the right score, I always get the PlayerScore null.

To Reproduce Steps to reproduce the behavior:

  1. Install unity 2021.3.22f1
  2. Install Google Play Games plugin GooglePlayGamesPlugin-0.11.01.unitypackage
  3. Run code above

Versions

  • Unity version: 2021.3.22f1
  • Google Play Games Plugin for Unity version: 0.11.01

Additional context I tested authentication on couple devices and Google accounts. Authentication always return SignInStatus.Success. I can get other players results, but I always get empty PlayerScore if user never played in my game. This issue started after update to 0.11.01.

steam3d avatar Apr 10 '23 16:04 steam3d