I’m trying to implement the Google Play Services into game. I’ve followed this guide: GitHub - playgameservices/play-games-plugin-for-unity: Google Play Games plugin for Unity
I’ve followed the setup instructions for the Play console, and I have setup my game inside Play Console (Google Play Console | Google Play Console). 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?