0

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!

Lee
  • 564
  • 7
  • 16

1 Answers1

0

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.

Evan Knowles
  • 7,426
  • 2
  • 37
  • 71
  • Yes thanks. It would seem that this is the issue after looking around my settings and playing with the app privacy i was able to replicate it. It's a shame facebook doesn't throw me a nice error code back, just returns empties or nulls... sigh. I definately aggree on your 'fear mongering' sentiment. Hide all the things, MI5 and the FBI are perusing your holiday photos in spain! – Lee Jun 28 '13 at 10:27