question

Ayman Ismail avatar image
Ayman Ismail asked

FriendInfo.FacebookInfo always present

In the documentation it says that "FacebookInfo" should only be present if "Available Facebook information (if the user and PlayFab friend are also connected in Facebook)."

https://learn.microsoft.com/en-us/rest/api/playfab/client/friend-list-management/get-friends-list?view=playfab-rest#friendinfo

but in my code:

 var request = new GetFriendsListRequest()
 {
     IncludeFacebookFriends = true,
     ProfileConstraints = new PlayerProfileViewConstraints()
     {
         ShowAvatarUrl = true,
         ShowDisplayName = true,
         ShowStatistics = true,
         ShowLinkedAccounts = true,
     }
 };
    
 PlayFabClientAPI.GetFriendsList(
         request,
         result =>
         {
             foreach (var friend in result.Friends)
                 friend.FacebookInfo;
    
         }, OnError);

FacebookInfo is always available for users that linked their accounts even if they aren't friends with my account or if I didn't even link my account to Facebook.

After going through the documentation I believe checking for this info is the only way for me to detect if this friend is one that was auto added from Facebook.

So is this a bug or is there any other way to check if a friend is manually added or included for Facebook friends

apisunity3dFriends
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

·
Neils Shi avatar image
Neils Shi answered

After my tests, whether or not you can get "FacebookInfo" is only related to whether you set parameter “ShowLinkedAccounts” to true. As long as you set the request body’s parameter "ShowLinkedAccounts" to true, then you can get your friends' "FacebookInfo" successfully (even if you don’t link your account to Facebook). It looks like the "FacebookInfo" is public information. So, using this “FacebookInfo” to check if a friend is manually added or included for Facebook friends is not suitable. Currently, PlayFab does not provide a method to check if a friend is manually added or included for Facebook friends. If this feature is important for you, you may post a feature request for it.

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

Ayman Ismail avatar image Ayman Ismail commented ·

That's a bit unfortunate, guess I'll have to implement my own Facebook Friend checker through friend list fetched from FacebookSDK. But still the documentation is misleading and I believe it should be edited to display the correct behavior as I've spent quite the time trying to figure out why the actual behavior differs from what the documentation stated.

1 Like 1 ·
Neils Shi avatar image Neils Shi Ayman Ismail commented ·

Thanks for pointing this out.

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.