Question

I want to create a facebook app for desktop that allows the user to choose albums and photos to send them later on through email or upload them to a server from which I could send the photos via email.

I'm new to Facebook programming and I would like to study what I need since my timeline is near. This is a college project.. I know php and some javascript. Your advice is greatly appreciated.

Was it helpful?

Solution

Follow these steps:

  1. Get the basic overview here: FB for sites and Graph API.

  2. Learn about Access Tokens

  3. Learn about Graph API Explorer- for testing.

  4. Login the user with facebook. There are many ways to do this, one simpler way is described here: Add the Login Code and replace FB.login() with :

    FB.login(function(response){
        if(response.status == 'connected'){
            //alert('I am connected')
        }
    },{scope: 'email, user_photos'});  // since you need to fetch email and the user photos from fb
    
  5. Then, you can fetch the user details using facebook API, just like:

    FB.api('/me/albums', function(response) {
       alert(response.name); 
    });
    

    You can see what all ab Album object gives you, here.

You can also use PHP instead of JS if you wish, works almost similar. PHP SDK Reference. Also, you can check out some samples here. (but dont let them confuse you)

Hope that helps!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top