question

Nicolas avatar image
Nicolas asked

GetFriendLeaderboardAroundPlayer not returning Facebook friend's scores.

We are trying to add an option to toggle between viewing all scores around a player to seeing their Facebook friend's score. When querying GetFriendLeaderboardAroundPlayer, we are only seeing the player's score even though IncludeFacebookFriends is set to true. Both of us have installed the game and logged in to PlayFab via our Facebook accounts and are definitely Facebook friends, shouldn't we be seeing each other's scores?

Am I missing something? Is there some additional configuration needed in order for PlayFab to be able to retrieve the Facebook's friend list and return the scores?

Leaderboards and StatisticsFriends
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image
brendan answered

[Edited to add the info from below]

No, there shouldn't be anything else. The requirements are:

1) Sign in the players with Facebook. Only if we have a current token from Facebook for the player can we query things on the player account.

2) The players have to be friends in Facebook.

3) The players have to have scores on the leaderboard.

4) The players have to have their Facebook privacy settings set to allow "friend" and "me" information to be returned.

5) You have to set "IncludeFacebookFriends" to true in the leaderboard call.

If all those things are true, your friends' scores will be available in the friends leaderboard - I've just re-tested that in my own title, and I'm seeing it work fine. If you're still not seeing it, can you provide: the Title ID, the PlayFab ID of both users, the Statistic ID, and the details of what API call you're making, the parameters passed in, and the response you're getting back.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Nicolas avatar image
Nicolas answered

I'm definitely not seeing it. Here's the info:

Title: Blackjack Royale (E580)

Players: C15BB3661934E758 and 866D5713111D75B9

Statistics: Tournament.Weekly

Here's the code for the call:

GetFriendLeaderboardAroundPlayerRequestrequest=newGetFriendLeaderboardAroundPlayerRequest();
request.IncludeFacebookFriends=true;

request.IncludeSteamFriends=false;
request.MaxResultsCount=10;

request.StatisticName="Tournament.Weekly";

PlayFabClientAPI.GetFriendLeaderboardAroundPlayer(request,
(GetFriendLeaderboardAroundPlayerResultresult)=>
{

Debug.Log(JsonConvert.SerializeObject(result));

});

Here's the Response I get:

{
"CustomData": null,
"Leaderboard": [
{
"DisplayName": "158-Nicolas P",
"PlayFabId": "C15BB3661934E758",
"Position": 0,
"Profile": {
"AdCampaignAttributions": null,
"AvatarUrl": null,
"BannedUntil": null,
"ContactEmailAddresses": null,
"Created": null,
"DisplayName": "158-Nicolas P",
"LastLogin": null,
"LinkedAccounts": null,
"Locations": null,
"Origination": null,
"PlayerId": "C15BB3661934E758",
"PublisherId": "C3123D9C14BA594E",
"PushNotificationRegistrations": null,
"Statistics": null,
"Tags": null,
"TitleId": "E580",
"TotalValueToDateInUSD": null,
"ValuesToDate": null,
"VirtualCurrencyBalances": null
},
"StatValue": 3600
}
],
"NextReset": "2017-11-19T00:00:00Z",
"Request": {
"IncludeFacebookFriends": true,
"IncludeSteamFriends": false,
"MaxResultsCount": 10,
"PlayFabId": null,
"ProfileConstraints": null,
"StatisticName": "Tournament.Weekly",
"Version": null
},
"Version": 20
}

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image brendan ♦♦ commented ·

There are actually two things I left off the list above, so I'll edit the answer there, but I'll also provide them here:

The friend must have a score on that leaderboard.

Both players must have their Facebook privacy settings set to allow friend information to be returned.

I suspect you've already checked the former, so the latter would be the other thing to check on. But I can confirm that if everything is set correctly, we're seeing Facebook friends in each others' friend leaderboards.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Error rendering WebPanel (widgets/consolidation-widget.ftl): org.hibernate.hql.internal.ast.QuerySyntaxException: AvailableConsolidation is not mapped [from AvailableConsolidation up where up.node = :node]