question

asaadmkgaming avatar image
asaadmkgaming asked

unity GetFriendsList facebook and profile info in one call

Salam,

i am able to get friend list with facebook using the following code


var FriendsListRequest = new GetFriendsListRequest();

FriendsListRequest.IncludeFacebookFriends = true;

PlayFabClientAPI.GetFriendsList(FriendsListRequest, OnSuccesFriendsListRequest, OnFailureFriendsListRequest);

in the result i can access the Facebook ID and name of the friends, but because i also need the profile picture and display name of non Facebook friends , i have added below code to the request to acces the profile info;

in the new results i am able to access the profile info and the Facebook friend do comeback in the Friends list but i get NULL reference when i try to access Facebook info such as the ID, please advise

PlayerProfileViewConstraints profile = new PlayerProfileViewConstraints ();

profile.ShowAvatarUrl = true;

profile.ShowDisplayName = true;

FriendsListRequest.ProfileConstraints = profile;

unity3dFriendsfeedback
10 |1200

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

brendan avatar image
brendan answered

What Title ID is this? Can you check that you have turned on the ability for the client to request those elements in the title Settings?

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.

asaadmkgaming avatar image asaadmkgaming commented ·

sorry for the late reply,title ID: 3AB2

there is no friends settings in the profile , i believe my issue is the same as this

one https://community.playfab.com/questions/14227/getfriendslist-not-returning-friendinfo-parameters.html

but i am not sure is it solved or what?

0 Likes 0 ·
brendan avatar image brendan asaadmkgaming commented ·

The issue from that post is that the Friend Tags don't show up correctly if you have any ProfileConstraints set. Is that what you mean, or are you seeing a different issue? If the issue is that you're not getting any profile info back, can you check that you have set the profile data to be returned to the client in the title's settings, and that you're using the ProfileConstraints to specify what you want?

0 Likes 0 ·
asaadmkgaming avatar image asaadmkgaming brendan commented ·

thanks for the reply, it seems that i haven't made myself clear enough;

as stated in my question i am able to get the friends Facebook info if the profile constraint is not set, once i assign a profile constraint to the request i get the profile display name, avatar URL but the Facebook info becomes null;

that is why i have related my question to the other one, it seems once the profile constraint is assigned it brings the profile data but other data such as tags and faceboof info become null, please advise how to solve.

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

please let me know if you found a solution

0 Likes 0 ·
moaz0005 avatar image
moaz0005 answered

@asaadmkgaming I am having the same issue. Please let me know if you found any solution. @Brendan My title ID is BF7C And Yes, I have turned on the Linked Account Setting in Client Profile Options for this title.

,

@asaadmkgaming I am having the same issue. Please let me know if you found the solution.

10 |1200

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

jawaad avatar image
jawaad answered

Following. As of September 2019 this is still an issue. I'm trying to add online fighting against friends to my game Munkee Kissin Dunkee 2 and set it up so that the friends list displays the users record (wins - losses and streak) and it looks like I need statistics to do so.

A workaround I'm trying is to see if I can share Player Data between friends - has anyone tried that?

I'm able to access Facebook friends when I don't try and download statistics but unable to do so otherwise.

Here is my get friends request code. Note I need to comment out ProfileConstraints portion to get friends to work.

My title id is 65CF

    void GetFriends()
    {
        PlayFabClientAPI.GetFriendsList(new GetFriendsListRequest
        {
            IncludeSteamFriends = false,
            IncludeFacebookFriends = true /*,
            ProfileConstraints = new PlayerProfileViewConstraints
            {
                ShowStatistics = true,
                ShowAvatarUrl = true
            }*/
        }, result => {
            PlayerInfo.fbFriends = result.Friends;
     
           DisplayFriends(PlayerInfo.fbFriends); // triggers your UI
        }, DisplayPlayFabError);
    }

,

Following. As of September 2019 this is still an issue. I'm trying to add online fighting against friends to my game Munkee Kissin Dunkee 2 and set it up so that the friends list displays the users record (wins - losses and streak) and it looks like I need statistics to do so.

A workaround I'm trying is to see if I can share Player Data between friends - has anyone tried that?

I'm able to access Facebook friends when I don't try and download statistics but unable to do so otherwise.

Here is my get friends request code. Note I need to comment out ProfileConstraints portion to get friends to work.

My title id is 65CF

    void GetFriends()
    {
        PlayFabClientAPI.GetFriendsList(new GetFriendsListRequest
        {
            IncludeSteamFriends = false,
            IncludeFacebookFriends = true /*,
            ProfileConstraints = new PlayerProfileViewConstraints
            {
                ShowStatistics = true,
                ShowAvatarUrl = true
            }*/
        }, result => {
            PlayerInfo.fbFriends = result.Friends;
      
           DisplayFriends(PlayerInfo.fbFriends); // triggers your UI
        }, DisplayPlayFabError);
    }


10 |1200

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

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.