Skip to main content
Version: 5.7.0

GetPlayerScore

Gets a player's score from a leaderboard. If the player does not have a score in a leaderboard this method returns an error.

ServiceOperation
leaderboardGET_PLAYER_SCORE

Method Parameters

ParameterDescription
leaderboardIdThe leaderboard to retrieve the score from
versionIdThe version of the leaderboard

Usage

http://localhost:3000
string leaderboardId = "default";
int versionId = -1;
SuccessCallback successCallback = (response, cbObject) =>
{
Debug.Log(string.Format("Success | {0}", response));
};
FailureCallback failureCallback = (status, code, error, cbObject) =>
{
Debug.Log(string.Format("Failed | {0} {1} {2}", status, code, error));
};

_bc.LeaderboardService.GetPlayerScore(leaderboardId, versionId, successCallback, failureCallback);
JSON Response
{
"status": 200,
"data": {
"score": {
"score": 100,
"data": {
"test": "testdata"
},
"createdAt": 1484933569566,
"updatedAt": 1484933569566,
"leaderboardId": "testLeaderboard",
"versionId": 150
}
}
}