playgameservices / play-games-plugin-for-unity

Google Play Games plugin for Unity
Other
3.45k stars 962 forks source link

Problem with posting score to leaderboard during testing #1873

Open siloni opened 7 years ago

siloni commented 7 years ago

Hi all, I have an unity app for which I have created an app in google play store. Currently I have just released one alpha version. I am using google play services for leaderboard. For this I have used play-games-plugin-for-unity"" plugin. Currently I have published the play services to alpha testers. I could install the app from playstore by logging as one of the testers. I can open the leaderboard. But my scores are not getting posted. Am I missing any step during testing. I am using the below code to post the score:

public void PostToLeaderboard(int score)
{
    playServiceLogin();
    //post score to leaderboard
    Social.ReportScore(score, leaderboardID, (bool success) =>
        {
            if (success) { }
            else
            {
                //Debug.Log("Failed to post score to leaderboard.");
            }
        });
}

Regards, Siloni

siloni commented 7 years ago

Hi, Has anyone faced this issue before? Any pointers would be of great help.

Regards, Siloni

siloni commented 7 years ago

Hi @claywilkinson, Can you please look into this issue and provide some resolution. This is stopping us from publishing our game as we have not been able to test the score posting to leaderboard feature yet.

Thanks in advance.

Regards, Siloni

siloni commented 7 years ago

Hi All/ @claywilkinson

Calling all experts !! Any pointers would be of great help.

Regards, Siloni

jsaraiva commented 7 years ago

Hi!

Have you tried debugging the app (by making a development build)? With the attached Unity Editor, you can sometimes view helpful error messages. In my case, it was because of an authentication problem, because of app signing keys (although that shouldn't be your issue, as you can see the leaderboard). Once that issue was solved, I was able to post to a leaderboard without issue.

Alternatively, try using logcat to view your app's error messages. Maybe you'll find something useful there. :-\

P.S.: Using 0.9.40 here. I assume you're using the latest version too.

siloni commented 7 years ago

Thanks for the reply @jsaraiva I used the logcat as you suggested. I added a log message when the posting to leaderboard is successful and its printing this log message on the logcat. So, now wanted to know if its not posting to leaderboard because in the developer mode?

if (success) {Debug.Log("Posted score to Leaderboard."); } else { //Debug.Log("Failed to post score to leaderboard."); }

jsaraiva commented 7 years ago

Hi, @siloni . Sorry for the late reply, too much stuff to handle these days.

If you're getting the message that the score was posted to the Leaderboard, then I'm at a loss here as to what the problem is. :-( It shouldn't be the development mode, as I've successfully posted scores to a Google Play leaderboard with development builds (I've confirmed it by viewing the leaderboard's UI). Also, you are logged in, otherwise you wouldn't be getting success == true in your check. Maybe it's something with the device itself?

Maybe @claywilkinson can be more helpful. :-\