question

brendan avatar image
brendan asked

Can't get Facebook friends to show up

Brendan Vanous
started a topic on Wed, 13 May 2015 at 11:55 PM

Question from a developer:

I've got multiple accounts set up in the PlayFab system, linked to their Facebook accounts. They're all friends, but they're not showing up in each other's friends lists when I call GetFriendsList. Why is that?

10 |1200

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

Dean Loades avatar image
Dean Loades answered

Thanks for the quick reply @Brendan.

I did eventually find out where to add the facebook keys. I noticed it states

"Note that you do not need to install this add-on in order to use the Facebook social graph for social leaderboards -- that feature is enabled by linking a player's Facebook credentials to their profile."

But I added them anyway.

Also:

a) I checked the access token options, it looks like it is not even possible to untick the user_friends box for me. So yes that is checked. Plus I am able to get them with the graph explorer with the same token.

b)Yes both friends have signed in with facebook.

The one that is calling get friends is 49F3B2131BD067F6. Although as I said previously their account says Origination: Facebook. But Linked accounts is empty.

The 2 accounts that should be friends are: 380FF17AA722A5D0 (says linked with facebook) and F92A8F649E140B64 (also linked)

c) Yes I am definitely setting IncludeFacebookFriends to true. The title ID is CBD7.

Also, breaking news, my colleague next to me is running the same build and he DOES get friends returned. His account is 380FF17AA722A5D0, and the friends returned are the other two accounts mentioned. So it is working as advertised for him. Seems like something to do with my account 49F3B2131BD067F6

\_(ツ)_/¯

Thanks again for the help!

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

Actually, that's true - back when this post was first written, it was thought that the ID (though not the Key) was required, but they're actually not, as we get all the info we need from the token. I've updated the answer to reflect that.

For the Friends issue, I see the problem. The account in question was indeed created via LoginWithFacebook - on a different Title ID in your Studio (C223). This normally wouldn't be a problem, but you used the same Facebook App ID for that Title ID as well. The way Facebook works is, it gives a unique ID for every App ID, so you can't re-use the App ID across multiple Title IDs in PlayFab. I've opened a work item to detect this and return an error code. The way to fix this for your testing right now is to either sign into the account in the other title and use the Unlink call, or else delete the player account from the other title, and then sign into CBD7 with Facebook.

10 |1200

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

Dean Loades avatar image
Dean Loades answered

Ok wow,

Yes that use case is likely what happened. I was testing with the same custom id in a different title and the same facebook app.

Awesome detective work there @Brendan. I am well impressed.

Happy to unlink and start again, its good to know what the issue was. I can't imagine that happening in a production situation.

10 |1200

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

chrissimon avatar image
chrissimon answered

Hi @Brendan,
I have a problem regarding friends. Didnt know where to post it. This was the only post remotely related. In the GetFriendsList API, Ive set IncludeFacebookFriends =true. This correctly fetches facebook friends of mine that have played the game. But in the GetFriendsListResult, the FacebookInfo is always null. Why is that?

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.

brendan avatar image brendan commented ·

Are you using any profile constraints? There's a known issue that we have a bug filed on, where if you're using the profile constraints to get profile data, the other friend info isn't returned. I've pinged the engineering team about getting that prioritized.

0 Likes 0 ·
chrissimon avatar image chrissimon brendan commented ·

Hi @Brendan,
Thanks for the quick reply. I don't think i'm using any profile constraints. Though, under the "ALLOW CLIENT ACCESS TO SENSITIVE PROFILE PROPERTIES", do i have to enable the "Linked Accounts". If i share the project ID, will that help?

Thanks for prioritising the issue. Much Appreciated.

0 Likes 0 ·
brendan avatar image brendan chrissimon commented ·

Yes, can you provide us with the Title ID of the game, and the PlayFab ID of the user you're using to test this?

0 Likes 0 ·
Show more comments
YangYi avatar image
YangYi answered

I have a problem regarding friends. Didnt know where to post it. This was the only post remotely related.

I have two facebook acounts Yang Yi and Star Rock, and they are facebook friends, and they have logged into playfab.But they aren't automatically add playfab friends each other. I can get friends through graph explore.

1 comment
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 commented ·

How are you checking if they're friends? If you're calling GetFriendsList, you have IncludeFacebookFriends set to true, both players signed in using LoginWithFacebook recently (so that we have a non-expired token), and neither of those players has their privacy set to block others from seeing their friends, they should show up fine. But they are not being added to the PlayFab-internal friends list, as that would violate Facebook policy.

0 Likes 0 ·
Jens-Stefan avatar image
Jens-Stefan answered

Hey,

How does the answer differ if I am creating an Facebook instant game? To login, I am instead using "LoginWithFacebookInstantGamesId". After this I then call "LinkFacebookInstantGamesId", which seems to be a success. However when I am trying to receive the friends' list using "GetFriendsList", it is empty. It is also empty when I try to look at the friend list of the player via the playfab dashboard in the browser.

The users I am testing this with are Facebook test users who are friended.

1 comment
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 commented ·

When you set "IncludeFacebookFriends" to true in a call to GetFriendList, we make a call to Facebook for any friends for the player, using the Facebook ID we have for the application (bear in mind that Facebook provides a different ID for players, for each application). Their documentation states that the will return a list of Facebook IDs for users that have also used the application. We use that to look up any other players in your game, who have signed in with Facebook (and so, have their Facebook ID in their user account), and return that in the list. If you're not seeing friends of a player returned, I'd recommend opening a ticket with the Facebook team to get additional information on why the specific players are not being returned.

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.