I have built a web-based game which submits players' scores to a leaderboard. The game also has a web page which shows the public scores from that leaderboard. It gets this data by hitting the scores.list API end-point. The leaderboard and game have been published in the Google Play Console.
Three players have played the game and their scores have been submitted. All three players have public Play Game profiles and the Leaderboard page in the Play Game Console shows that multiple unique scores have been submitted. But when my Javascript code hits scores.list, only the player's own score is returned in the items collection, not those of the other two players.
How do I get all the scores from the leaderboard?
var request = gapi.client.games.scores.list({
leaderboardId: leaderboardId,
collection: 'PUBLIC',
timeSpan: 'ALL_TIME'
});
request.execute(function(response) {
if (response.items) {
response.items.forEach(function(item) {
// Print item.formattedScore to screen.
// Only the currently signed-in player's score is returned.
})
}
})
The public leaderboard is a leaderboard made up of players who have chosen to share their gameplay activity publicly. If your player has not chosen to share their gameplay activity publicly, they won't appear in this leaderboard.
So you probably need to check that your test users have checked the option to share their gameplay data publicly. – ExecratoryAllow others to see your game activity
option enabled. Their Play Games profiles are also public. I don't know why I'm still not getting all players' scores. – Classified