Dear PlayFab community.
I am trying to write a CloudScript endpoint that will return a player's friends list, including whatever FriendTags would be associated with the friends.
The Server API GetFriendsList does *not* appear to be returning the FriendTags, and I'm wondering why.
Here is what I see in Game Manager:
And here is what server.GetFriendsList is returning:
"Friends": [ { "FriendPlayFabId": "121BD68E8A8B5E87", "Profile": { "PublisherId": "1855D4D27C9DFD4C", "TitleId": "44B1", "PlayerId": "121BD68E8A8B5E87" } } ]
Is there any way to get the FriendTags? I need this information with which to filter friends as per this two-way friend confirmation recommendation.
Any help would be much appreciated!
Answer by John Peterson · Oct 27, 2018 at 04:54 PM
Hmmm...I see something interesting when I call GetFriendsList():
If I call it with an undefined ProfileConstraints (for GetFriendsListRequest), I do get the FriendTags!
But if I call it with anything in ProfileConstraints, I do not get the FriendTags.
It's almost like ProfileConstraints should have a "ShowFriendTags" or something.
Is there any way to specify ProfileConstraints *and* show the FriendTags? Or am I going to need to call GetFriendsList() twice and merge the data to get the results that I need?
You're right! I was investigating this a bit this morning and noticed the same thing. Taking a look at the service code, when a profile is specified we build the response differently and don't include the tags. That seems like an oversight. It should be a pretty simple fix. I'll get the bug filed.
For now, unfortunately, you're left with needing to make two calls if you need profile data and tags.
GetFriendsList critical error 3 Answers
Add Friend in CloudScript Issues 1 Answer
RemoveFriend is not always working 2 Answers