Reputation: 516
I am using the google play games Unity3D api on Unity 2018.2.15f1, it should be noted that my google play games project isn't published however I don't want to publish it until I have all my achievements in there.
The leaderboard posting code is:
public void PostScore(long score)
{
Social.ReportScore(score, GPGSIds.leaderboard_high_scores, (bool success) => {
// handle success or failure
if(success)
{
Debug.Log("Posted Score of " + score);
}
else
{
Debug.Log("Failed to post score");
}
});
}
and logcat consistently shows that this returns a success, as so:
11-16 02:45:05.041: I/Unity(5503): (Filename: ./Runtime/Export/Debug.bindings.h Line: 43)
11-16 02:45:05.042: I/Unity(5503): Posted Score of 19
However no matter what the leaderboard doesn't update, it consistently shows a score of 8. I don't understand why this is here as it shows up exclusively on my device even and even if I wipe the leaderboard it persists.
Is the issue with the fact that the leaderboard isn't published yet? Or could there be something else at play.
Upvotes: 0
Views: 2314
Reputation: 3718
In my case the problem got solved when I edited my GameServices profile and enabled the checkbox "Let others see your game activity".
Before that no matter what I did, all reported scores got ignored.
Upvotes: 8
Reputation: 516
The issue was GPGS was caching the leaderboard scores and refusing to update them from the remote copy, the solution was to modify the IPlayGamesPlatform
interface to support passing in a custom Types.DataSource
parameter. This allows for the option to view the cached and networked version or just the networked version.
Upvotes: 2