question

rrrodneyyy avatar image
rrrodneyyy asked

How to access details of Facebook linked account?

Hi

Regarding Accounts that have been created by linking with Facebook Games. I noticed on the Playfab player account "Overview" page has an "Identities" section that lists the first name of the Facebook account linked to the playfab account, and the Facebook logo.

Is there any way I can access the Facebook account username, surname or any other information that allows me to actually look up the player on Facebook? I want to take a sample of user demographics for marketing.

There may be some basic thing that I am missing regarding querying Facebook for this info in the login code. I have used a Unity asset where someone else has done the coding for me but I've done quite a lot of modification to their code to save/load data to playfab statistics etc. However I personally wasn't the one who made the code, so I'm lacking the knowledge as to whether or not it's a case of simply adding a line of code. Since the Unity asset I have seems to only obtain the "first name" of the Facebook user, and I don't know if that's a standard thing, or whether it's just as easy to get the surname or facebook username.

data
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

·
Sarah Zhang avatar image
Sarah Zhang answered

You can’t use PlayFab API to access the detailed information of Facebook account. PlayFab will automatically obtain the limited Facebook account information after you linked PlayFab accounts with Facebook accounts, but we won’t obtain the full Facebook profile.

To get the full profile of the specific Facebook account, you can call the Facebook API directly. As the same as calling the API LoginWithFacebook, LinkFacebookAccount, you also need to use the Facebook account’s Access Token to access the Facebook Graph API. Therefore, you can cache the Access Token after every calling of LoginWithFacebook so that you can access the user’s Facebook Profile through Facebook API. You can check the Facebook document -- https://developers.facebook.com/docs/graph-api/using-graph-api for more information about how to use the Facebook Graph API. Then read the Facebook Unity SDK documentation -- https://developers.facebook.com/docs/unity/gettingstarted to learn how the SDK interact with the Graph API.

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.