We're getting a friend list via CloudScript with the following function:
export function GetFriendList(playerID): PlayFabServerModels.FriendInfo[] { let retVal = server.GetFriendsList({ IncludeFacebookFriends: true, IncludeSteamFriends: false, PlayFabId: playerID, ProfileConstraints: CreatePlayerProfileViewConstraints(true, true, true) }).Friends; return retVal; }
This gives us the following result:
{\"FriendPlayFabId\":\"2147A0DD303F88A2\",\"Profile\":{\"PublisherId\":\"9FC655C648B8DA29\",\"TitleId\":\"6131\",\"PlayerId\":\"2147A0DD303F88A2\",\"LastLogin\":\"2017-12-13T17:32:12.368Z\",\"DisplayName\":\"jhghgj\",\"Tags\":[]}}
It only contains the profile and the PlayFabId, but not the Friend-Tags, as the documentation says:
https://api.playfab.com/documentation/server/method/GetFriendsList
If we set null for ProfileConstraints, we get this:
{\"FriendPlayFabId\":\"2147A0DD303F88A2\",\"TitleDisplayName\":\"jhghgj\",\"Tags\":[\"ReferralAcquisitionByLocalPlayer\"],\"FacebookInfo\":{}}
And it contains the Friend Tags this time! (One tag: ReferralAcquisitionByLocalPlayer)
But if we need both, the profile and the tags - we have to call the function twice and combine the results, therefore resulting in two API Calls.
Is there any fix for this?
Answer by Brendan · Dec 14, 2017 at 12:00 AM
Thanks - that's a good catch. It looks like the fact that the profile also has a "Tags" is what tripped us up, it looks like. I'll open a bug to get this fixed.
Thank you! Though it's not only the tags, also the TitleDisplay name is removed from the output. But that is available in the profile, so it might be intentional...though the documentation might say otherwise ;)
Right, things that are replicated in the profile are only in the profile if you use ProfileConstraints. Basically, the API call predates the profile info, so it was done that way to be consistent with the intended usage of the profile (so, if you want the profile, but don't ask for that specific info, we shouldn't return it).
This bugs is not fixed yet, I am trying to fetch the friend tag but i can not do so if ProfileConstraints is not null. When will this be fixed?
We are simply doing two fetch calls now. It's the only way really. It's sad since it takes double API calls then it should be, but it's a workaround.
Yes, that would be the workaround to use for now. We're very heads-down on making absolutely certain that all aspects of GDPR compliance are complete well ahead of the May 25th deadline right now, so work on items like this (where there is a usable workaround) will be somewhat delayed.
Hello. More than a year has passed since the last message was posted on this issue and it still hasn't been fixed. Any news on when and if it will finally be fixed?
GetFriendsList critical error 3 Answers
Add Friend in CloudScript Issues 1 Answer
RemoveFriend is not always working 2 Answers