Search code examples
c#facebookimageprofiles

Facebook c# api getting albums for some users but not others


I am trying to get the albums from a user by using the following line...

var useralbums = context.Client.Get("/" + UserId+ "/albums");

The user id is passed in as an argument from a profile page. The strange thing is around 90% of these requests work just fine, but for about 1 in 10 of my friends list an empty array is posted back.

I looked at these friends on facebook and there seems to be nothing extraordinary about the way their albums are arranged that might cause an error.

By way of debugging I added the following extra line

var user = context.Client.Get("/" + UserId);

Sure enough all of the calls return a valid list of profile elements. So the user id is definitely correct.

I simply can't understand the fact that this seems to work fine for 90% or so of the users. Any help greatly appreciated!


Solution

  • It's most likely a privacy issue - with all the fear mongering going around, a lot of people have set their privacy settings to not allow apps access, which would prevent your app from viewing the album.