Andrew Sheldon
Andrew Sheldon

Reputation: 11

Get list of Albums facebook c# sdk

Using c# or vb.net how can Obtain a list of album IDs?

I can get the JSONObject but don't know how to extract the IDs.

This is as far as I get in VB:

 Dim fbApp = New FacebookClient(accessToken.Text)
 Dim albums = DirectCast(fbApp.[Get]("me/albums"), IDictionary(Of String, Object))

How can i get just albums IDs into a new array?

Upvotes: 1

Views: 2352

Answers (1)

Afnan Bashir
Afnan Bashir

Reputation: 7429

I am not into VB so you can do something in c# you got to figure way via VB yourself.

This works in c#

//Get the album data
dynamic albums = app.Get("me/albums");
foreach(dynamic albumInfo in albums.data)
{
   //Get the Pictures inside the album this gives JASON objects list that has photo attributes 
   // described here http://developers.facebook.com/docs/reference/api/photo/
   dynamic albumsPhotos = app.Get(albumInfo.id +"/photos");
}

Upvotes: 1

Related Questions