Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 888
TCM Avatar asked Feb 06 '11 12:02

TCM


1 Answers

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.

like image 134
el_tone Avatar answered Nov 01 '22 17:11

el_tone