1

I'm trying to get latest profile pictures of the requesting user (with the user_photos permission, of course). Getting the current profile picture is trivial, getting the latest photos (including all photos, not just profile pictures) is trivial, but getting latest profile pictures explicitly doesn't seem to be trivial.

I can get all albums, iterate them all, find the one with the type set to profile, then find photos in that albums by its ID. But this includes multiple queries, and I'm not even counting corner cases where user may have too many albums updated recently that we need to paginate down to Profile Pictures album etc.

Is there a way to get current user's latest profile pictures in a single query, just like in the old days of FQL?

Can Poyrazoğlu
  • 33,241
  • 48
  • 191
  • 389
  • 2
    I don’t know any way to get that all in one request. You will need to find the profile pictures album id first, and that means looping through all albums (although with a high enough `limit` I think chances are quite low that you will need to paginate.) I think the photos within an album are always sorted by upload date, in descending order. However, if the user should chose to use an “old” image as their profile picture _again_, that won’t be reflected at all. – CBroe Jan 08 '16 at 11:49

0 Answers0