- Home /
Google Play Services show leaderboard
I'm trying to implement the Google Play Services into game. I've followed this guide: https://github.com/playgameservices/play-games-plugin-for-unity
I've followed the setup instructions for the Play console, and I have setup my game inside Play Console (play.google.com/apps/publish). I have set a test account up, which I'm currently using. I don't know what I did wrong, but I havn't used the Signing Certificate fingerprint (SHA1) at all.
I am currently using a version of my APK, that isn't on the play store, because of testing.
I am able to sign in just fine, but the report score doesn't work as it should. Nor does the ShowLeaderBoardUI. I have tried different things, but this is my current version of the code:
if(GUI.Button(new Rect (Screen.width/2 - 105*u, Screen.height/3 + 450*u, 210*u, 210*u), "Score")){
// Activate the Google Play Games platform
PlayGamesPlatform.DebugLogEnabled = true;
PlayGamesPlatform.Activate();
Social.localUser.Authenticate((bool success) => {
if(success){
Social.ReportScore(PlayerPrefs.GetInt ("best"), "CxxxxQ", (bool s) => {
((PlayGamesPlatform) Social.Active).ShowLeaderboardUI("CxxxxQ");
});
} else {
print ("Did not authenciate.");
}
});
}
I have tried the following two versions too:
Social.ReportScore(PlayerPrefs.GetInt ("best"), "CxxxxQ", (bool s) => {
if(s) {
((PlayGamesPlatform) Social.Active).ShowLeaderboardUI("CxxxxQ");
} else {
print ("Something went wrong");
}
});
and
Social.localUser.Authenticate((bool success) => {
if(success){
Social.ReportScore(PlayerPrefs.GetInt ("best"), "CxxxxQ", (bool s) => {
if(s) {
((PlayGamesPlatform) Social.Active).ShowLeaderboardUI("CxxxxQ");
} else {
print ("Something went wrong");
//Just to test if it's called, since I can't see the print
Application.LoadLevel(Application.loadedLevel);
}
});
None of them are called however, and I can't see why not?
There is an update to GooglePlayServices Unity plugin on GitHub. Try it.
Answer by BBQBoys · Aug 14, 2018 at 07:03 PM
Hey @Potices,
I've had similar problem, I could not figure it out, followed all the guidelines but without success.
But finally I have decided to publish game (signed, so I recommend you do that as well) to alpha and suddenly it started to work so try to sign it and publish to alpha it might just work. :)
If you find this advice useful please try my game. https://play.google.com/store/apps/details?id=com.HOTBBQ.MarshatheMarshmallow&hl=en
Your answer
Follow this Question
Related Questions
Google Play Games Plugin(A simple issue) 0 Answers
Google play services leaderboards 1 Answer
Google Play Leaderboard help 0 Answers
Can't see public leaderboard from google play 1 Answer
How to Implement Google Play Games? 0 Answers