playgameservices / play-games-plugin-for-unity

Google Play Games plugin for Unity
Other
3.43k stars 953 forks source link

After successfully ReportScore, method LoadScores return null PlayerScore #3244

Open steam3d opened 1 year ago

steam3d commented 1 year ago

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

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.