Documentation

Support

Get scores for other players from a leaderboard version

Retrieve scores for other players from a specific leaderboard version.
Read time 1 minuteLast updated 21 days ago

Get the scores for other players from a leaderboard version with the
GetVersionScoresByPlayerIdsAsync
method:
public async void GetVersionScoresByPlayerIds(string leaderboardId, string versionId){ var playerIds = new List<string>{ "abc123", "abc456" }; var scoresResponse = await LeaderboardsService.Instance .GetVersionScoresByPlayerIdsAsync( leaderboardId, versionId, playerIds ); Debug.Log(JsonConvert.SerializeObject(scoresResponse));}
To get the score with any associated metadata, use the
IncludeMetadata
option on the
GetVersionScoresByPlayerIdsOptions
configuration object:
public async void GetVersionScoresByPlayerIdsWithMetadata(string leaderboardId, string versionId){ var playerIds = new List<string>{ "abc123", "abc456" }; var scoreResponse = await LeaderboardsService.Instance .GetVersionScoresByPlayerIdsAsync( leaderboardId, versionId, playerIds, new GetVersionScoresByPlayerIdsOptions { IncludeMetadata = true } ); Debug.Log(JsonConvert.SerializeObject(scoreResponse));}
For details on how to get available leaderboard version IDs, visit Get available leaderboard version.