Google Play Leaderboard - Cannot Submit Score

I would like to pick your brains on something that might be as simple as a config issue.

I am developing a game using Xamarin Forms and I have an issue when I am trying to submit a time score to Google Play Leaderboards.

The user signs in correctly with Google Play and I can see the leaderboards correctly but I cannot submit a score.

I am suspecting that this is because my project in Android Studio is on internal testing phase (less than Alpha). The game, game services and leaderboards are published. The published APK is for the previous version of the game which didn't have the leaderboards code added.

When I use GamesClass.Leaderboards.SubmitScore() it will not error but then the leaderboard is corrupted and when the leaderboard is shown, it says something went wrong. Reinstalling the app is the only way to fix it. Using GamesClass.Leaderboards.SubmitScoreImmediate doesn't error and the leaderboard is not corrupted, but the score is not shown.

This is my call to submit the score in the MainActivity.cs (Android project)

if (mGoogleApiClient.IsConnected)
{
  var result = await GamesClass.Leaderboards.SubmitScoreImmediate(mGoogleApiClient, LeaderboardID, score);
  return true;
}

Upvotes: 1

Views: 1327

Answers (1)

After a lot of testing and retesting, the issue was that the API Oauths were not set correctly (even though they looked ok) in Google Play Console.

The error message when submitting a score and then viewing the leadeboard was because of the above and not a real leaderboard corruption or error.

I resolved it by creating two Game Services linked to the same application, one authorised with my upload certificate and the other authorised with Google App signing certificate.

This now allows me to use Google Play Services while debugging (Upload certificate) and from the Play Store app (Signing certificate).

Hope this might help anyone with similar issues.

Upvotes: 3

Related Questions