question

Alberto avatar image
Alberto asked

GetFriendsList not returning correct data

When trying to get Friends statistics and more info it always returns null.

My code looks like this:

var request = new GetFriendsListRequest
{
    ProfileConstraints = new PlayerProfileViewConstraints
    {
        ShowStatistics = true, 
        ShowLastLogin = true
    }
};
PlayFabClientAPI.GetFriendsList(request, ResultCallback, ErrorCallback);

I made sure that the friends of the user that I'm logging with had statistics and obviously they have logged in recently so LastLogin should also be different than null. Any tips?

Friends
10 |1200

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

Citrus Yan avatar image
Citrus Yan answered

Did you check the Client Profile Options for “Statistics” and “Last Login Time” in [Game Manager] -> [Settings] -> [Client Profile Options]:

If you’ve already checked that and it’s still not working, then could you please provide the title id and the PlayFab ID of the player in question?


10 |1200

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

Alberto avatar image
Alberto answered

Solved by checking those settings. It would be great to have that in the documentation too. Thanks!

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.

Citrus Yan avatar image Citrus Yan commented ·

Actually, it's stated in the API ref's Description section:

"If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, only the allowed client profile properties for the title may be requested. These allowed properties are configured in the Game Manager "Client Profile Options" tab in the "Settings" section."

https://docs.microsoft.com/en-us/rest/api/playfab/server/friend-list-management/getfriendslist?view=playfab-rest#request-body

1 Like 1 ·

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.