Shaun
Shaun

Reputation: 2181

Is it possible to display Facebook user photos if someone isn't logged into Facebook?

I'm in the draft stage of designing a charity site for a friend of mine, and we'd like to be able to display photos of people who donate (they would have the choice of turning their photo on or off).

I'm used to logging people into another app of mine via Facebook, and retrieving their basic data.

What I'm wondering is - since the person viewing the site would be the only one logged into it, is it even possible to display photos of Facebook users who have donated ie can you retrieve a FB user photo if they aren't logged in?

If not, are you allowed, with the user's permission, to store their Facebook photo?

Thanks for your time and help.

Upvotes: 0

Views: 127

Answers (1)

Tobi
Tobi

Reputation: 31479

Have a look at

It's stating

Because profile pictures are always public on Facebook, this call does not require any access token.

This means as long as you requested the public_profile permission upon Facebook Login, and stored the app-scoped user_id in your database somewhere, you can use this app-scoped user_id to generate the profile picture image sources as follows:

<img src="https://graph.facebook.com/{app_scoped_user_id}/picture?type=large&redirect=true"/>

and replace {app_scoped_user_id} by the real app-scoped user_ids in some kind of loop.

Upvotes: 2

Related Questions