question

max avatar image
max asked

Server API - Possible Bug: You only get Friend tags with the GetFriendList call if the parameter ProfileConstraints is null

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?

CloudScriptFriends
10 |1200

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

1 Answer

·
brendan avatar image
brendan answered

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.

7 comments
10 |1200

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

max avatar image max commented ·

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 ;)

0 Likes 0 ·
brendan avatar image brendan max commented ·

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).

0 Likes 0 ·
cqatproject avatar image cqatproject commented ·

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?

0 Likes 0 ·
max avatar image max cqatproject commented ·

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.

0 Likes 0 ·
brendan avatar image brendan max commented ·

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.

0 Likes 0 ·
Show more comments
macrochipgames avatar image macrochipgames commented ·

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?

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.