TCM
TCM

Reputation: 16900

How can i get photos from albums? facebook c# sdk

I am using Facebook C# SDK and it's working pretty well. I want to show user's albums and it's photos on my site. I am using graph api. I did get the albums using this method :-

   fb.GetAsync("me/albums/photos", (val) =>
            {
                if (val.Error == null)
                {
                    IDictionary<string, object> dict = val.Result as IDictionary<string, object>;


                }
                else
                {
                    // TODO: Need to let the user know there was an error
                    //failedLogin();
                }
            });

How do I get the photos present in each of these albums?

Upvotes: 6

Views: 5469

Answers (2)

el_tone
el_tone

Reputation: 1192

An album is a graph object so once you have its id you can retrieve it like so:

http://graph.facebook.com/{albumid}/photos?access_token={token}

You can also use dynamics with the SDK (if you are using .Net 4) which eliminates the need to cast to <IDictionary> in the callback and makes for much cleaner code when diving through the graph objects.

Upvotes: 3

Awais Qarni
Awais Qarni

Reputation: 18016

Hi why you dont use FQL to query album and Poto tables to get what you want :-)

Upvotes: 0

Related Questions