question

Deekshith avatar image
Deekshith asked

Tags does not show in GetFriendLeaderboard

I have made a two way friend system. So when two users are friends they both of them are added to their respective friend list and also I am setting some tags(ex: confirm)

Now, when any of these player calls GetFriendLeaderboard API with "ShowTags" as true. I would expect that the tag "confirm" shows up in the tag array in the response. But this is not the case, I am getting empty tag array


Why is the tag "confirm" not been shown up in the response?

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

1 Answer

·
Citrus Yan avatar image
Citrus Yan answered

The “tag” you were expecting to retrieve from the GetFriendLeaderboard API call is not the same thing as the one you set for the player’s friend. The former is in the PlayerProfileModel representing each player’s profile, which is set by the AddPlayerTag API, however, the latter resides in the FriendInfoModel, which is set by the SetFriendTags API. If you want these friend tags to show up in your game’s Leaderboard interface, you may also need to call the GetFriendsList API to get each player’s friend tags and combine them with the results returned from the GetFriendLeaderboard API.

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

HackerTester avatar image HackerTester commented ·
@Citrus Yan Yeah that would Work Exactly how i wanted but i am having a problem i dont know how to work with tags in playfab and i can't even find a pinch of code to get around with it 

// Here's my code i don't know how to do it 

 public void GetFriendsList(System.Action<GetFriendsListResult> result, System.Action<PlayFabError> error){
            GetFriendsListRequest request = new GetFriendsListRequest();
            request.IncludeSteamFriends = false;
            request.IncludeFacebookFriends = false;
            request.XboxToken = null;
            request.ProfileConstraints.ShowTags = true;

            PlayFabClientAPI.GetFriendsList(request, result=>{

	FriendList = result.Friends;

	foreach(friendinfo Friend in FriendList){

	Friend.Tags   // Don't Know What to do here plz help suppose i wanted to get tag for confirm now what to do ?
	
}


}, error);
        }

1 Like 1 ·
Seth Du avatar image Seth Du ♦ HackerTester commented ·

Hi @HackerTester, have you enabled the access of Tags at [Game manager] -> [Title Settings] -> [Client Profile Options] ?

0 Likes 0 ·
HackerTester avatar image HackerTester Seth Du ♦ commented ·
@SethDu

i think the ans to my question was on this thread Thanks for helping ----

https://community.playfab.com/questions/54847/how-to-work-with-tags-in-playfab-friends.html

1 Like 1 ·
Show more comments

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.