Skip to main content
Version: 5.7.0

GetSocialLeaderboard

Note that friend summary data is returned for each record in the leaderboard.

Method returns the social leaderboard. A player's social leaderboard is comprised of players who are recognized as being your friend. It includes

  • All external friends (Facebook, Steam, PlaystationNetwork)
  • All internal friends (brainCloud)
  • Plus “self”.

Leaderboards entries contain the player's score and optionally, some user-data associated with the score. The currently logged in player will also be returned in the social leaderboard.

caution

If no friends have played the game, the bestScore, createdAt, update will contain NULL.

ServiceOperation
leaderboardGET_SOCIAL_LEADERBOARD

Method Parameters

ParameterDescription
leaderboardIdThe id of the leaderboard to retrieve
replaceNameIf true, the currently logged in player's name will be replaced by the string "You"

Usage

http://localhost:3000
string leaderboardId = "default";
bool replaceName = false;
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.GetSocialLeaderboard(leaderboardId, replaceName, successCallback, failureCallback);
JSON Response
{
"status" : 200,
"data" :
{
"social_leaderboard": [
{
"updatedAt": 1395840936348,
"pictureUrl": null,
"playerId": "26f8bb07-3e94-458b-8485-f9031c3a6ef1",
"createdAt": 1395840936348,
"name": "You",
"otherData": null,
"authenticationType": null,
"externalId": null,
"summaryFriendData": null,
"score": 20000
},
{
"updatedAt": 1395840936351,
"pictureUrl": null,
"playerId": "3ad8bc09-4a34-e324-1231-3b2c1c3a6bc6",
"createdAt": 1395840936351,
"name": "Jenny Goldsmith",
"otherData": null,
"authenticationType": null,
"externalId": null,
"summaryFriendData": null,
"score": 10000
}
],
"timeBeforeReset": 588182412,
"server_time": 1395840957588
}
}