playgameservices / play-games-plugin-for-unity

Google Play Games plugin for Unity
Other
3.46k stars 965 forks source link

Can't ReportScore() with metadata #2923

Open JasonSpine opened 4 years ago

JasonSpine commented 4 years ago

My app could report scores and display them in-game - worked OK.

PlayGamesPlatform.Instance.ReportScore(
    score,
    "Leaderboard ID...",
    (bool reportSuccess) =>
    {
        if (reportSuccess)
        {
            //...
        }
        else
        {
            // ...
        }
    });

Then I decided to extend scores display by showing players avatars next to their highscores. I wanted to use score metadata to store information about players equipped items. Three coma separated numbers per item, e.g.: 0,1,5,1,1,8,2,0,6,3,0,1,4,1,8,5,0,8,6,0,0,7,0,5,

So I used the second version of ReportScore method (with metadata):

PlayGamesPlatform.Instance.ReportScore(
    score,
    "Leaderboard ID...",
    equippedItems.GetScoreMetadata(), // "0,1,5,1,1,8,2,0,6,3,0,1,4,1,8,5,0,8,6,0,0,7,0,5,"
    (bool reportSuccess) =>
    {
        if (reportSuccess)
        {
            //...
        }
        else
        {
            // ...
        }
    });

And it doesn't work.

reportSuccess is true in both cases, but only the first method reports the score properly. The second method doesn't send the score to the leaderboard - I can't see it anywhere.

Each tested APK was uploaded to Google Play and player was logged in during the test. Is metadata functionality alive?

JasonSpine commented 4 years ago

2930

Upgraded PGP to v0.10.10 in my project and reporting score still doesn't work.

DmitryVrn commented 3 years ago

Is there any news about this issue. The ability to add metadata to the score is critical for my project.

JasonSpine commented 3 years ago

@DmitryVrn: didn't test v0.10.11, but there is a workaround, you may code some data and attach it to your score value.

12 digits => max

You may for example use 5 digits to store score value and 7 digits for the data, you want to store.