Search code examples
facebookfacebook-graph-api

How to add a "Facebook" button which allows users to select an image FROM Facebook and return it to my website


I have a Web-to-Print store where users can upload their own images. I need a way for users to be able to click a "Facebook" button, log in, and select one of their photos (which is then returned to our website).

This seems like it should be pretty easy and is extremely common on Web-to-Print sites, but I can't find any information on it and all searches resulted in uploading an image TO Facebook.

The Facebook API doesn't seem like it would offer a good user experience, and the SDK doesn't seem to support selecting and then pulling in an image. Is there no pre-made way to do this or Am I missing something?


Solution

  • There is no prebuilt function, you would have to authorize the user with the user_photos permission and use the /me/photos endpoint to get his photos: https://developers.facebook.com/docs/graph-api/reference/user/photos/