question

Henry Nyberg avatar image
Henry Nyberg asked

How to get facebook friends using playfab?

i have been trying to access the facebook friendlists of the facebook test users through playfab. am using this code

Public void FriendLists () {
    GetFriendsListRequest Request = New GetFriendsListRequest ();
    request.IncludeFacebookFriends = درست ؛
    PlayFabClientAPI.GetFriendsList (درخواست ، GetFriends ، FriendListError) ؛
}

GetFriends is invalid (GetFriendsListResult result) {
    Friends = Result. Friends
    Debugging. Login ("Friends");
    for (int i = 0؛ i <friends.Count؛ i ++) {
        Login debugging (Friends [I]. Username);
    }
}

I have saved the Facebook app password in the playfab / setting / secret keys

All my test users are friends

I also logged in from individual accounts to play fab.

But the friends list is still empty.

Where do I go wrong?

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

Please make sure you completed these steps described in this thread: https://community.playfab.com/questions/349/206711587-Can-t-get-Facebook-friends-to-show-up.html

  1. Be sure to have an application set up in the Facebook Developer site.
  2. Get the access toke and make sure that both player accounts have their privacy settings set to allow apps to get friend list.
  3. Sign into those PlayFab accounts one by one via Facebook, the purpose is to have all those accounts linked with their Facebook accounts. Furthermore, make sure that we have a current access token (we cannot use expired tokens to query the data for you) from Facebook by using the Facebook login every few hours, after that you should be able to see their friends in the GetFriendsList call.

For more details, please navigate to the link above to learn more.

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.