question

brendan avatar image
brendan asked

Facebook account picture as avatar

brainbeat.club
started a topic on Mon, 04 May 2015 at 12:07 AM

Hi

I would like to use user's facebook account picture as avatar in my web game.

Now I use User Data to store url to user's picture in facebook, and retrieved it using GetUserData.

But I don't think this is the good solution.

The avatar picture at least must be copied somewhere.

What is the best way to copy/store/retrieve picture (avatar) using User Data?

Is it better use some CDN instead?

Regards

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

·
brendan avatar image
brendan answered

6 Comments
Brendan Vanous said on Mon, 04 May 2015 at 2:44 PM

Could you elaborate on why it would be preferable to copy the image elsewhere, in this case? Is the concern that it takes two calls (one to PlayFab to get the URL, and one to Facebook to get the image)? Generally speaking, games which use Facebook accounts do tend to use the Facebook image URL directly, since it will then be kept current. So if the player changes their profile picture, you'll automatically be on the current version in your game.

Brendan


brainbeat.club said on Mon, 04 May 2015 at 2:59 PM

My concerns are:

  • I heard that facebook people don't like other applications to use their Facebook CDNs, because of heavy load

  • facebook picture url exposes user information


Brendan Vanous said on Mon, 04 May 2015 at 7:10 PM

I haven't heard of a usage restriction on this as yet, but if you have a reference page in their documentation that talks about this, I would be happy to review it. It's possible to encode an image as a Base64 or UUEcoded string and store that as a Value in User Data, but it's not as efficient and doesn't update when the user changes their image, so I really wouldn't recommend it.


brainbeat.club said on Tue, 05 May 2015 at 11:54 PM

Here is a discussion on such topic: http://meta.stackexchange.com/questions/107542/privacy-and-policy-issues-exposing-facebook-user-ids


Brendan Vanous said on Wed, 06 May 2015 at 12:10 AM

I'm afraid I don't follow. The referenced Facebook policy states that Facebook IDs cannot be used outside the Facebook application. We provide the ability to link to Facebook accounts and access user info based on the Facebook ID, but that's all within the context of your Facebook application. There's nothing there which would indicate that you cannot use the existing Facebook API calls to get the user's Facebook picture, so it doesn't look like there should be any issue.


brainbeat.club said on Wed, 06 May 2015 at 1:50 AM

Ok then. I'm going with Facebook CDN.

Avatar urls are stored in User Data and are fetched via GetUserData wherever is needed, so it should be easy to switch to some other CDN in the future.

Thanks

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.