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.
})
}
})