Search code examples
iosfacebookfacebook-graph-apifacebook-ios-sdkfacebook-graph-api-v2.0

Graph API not returning all tagged in photos


So when I query the graph api with this

GET /v2.5/me/photos

It only returns 9 of my tagged in photos. All of them but one have been uploaded by me. On my Facebook account I have many more photos in which I am tagged. This test was done in the Graph API Explorer with a user_photos permission token.

The primary place that I am using this is in my iOS app using the FB iOS SDK. This used to work as expected, returning all my tagged in photos. However something changed when I upgraded to the FB iOS SDK version 4. I have a feeling that doing this may have bumped up my apps minimum graph api version in my apps dashboard. And now I am in this position where I can't retrieve all my tagged in photos. My app has been approved for user_photos permission.

Any help would be greatly appreciated!


Solution

  • Thanks to @Vizllx for providing a link to another answer that enabled me to work it out.

    The linked answer suggests using an additional user permission. This permission didn't have an effect however this lead me to try turning on and accepting all permissions which worked! I then disabled them all again and went through and figured out which had the effect. Turns out it was the user_friends permission!

    So to get a tagged in photo that was NOT uploaded by the user you are querying, there are two conditions:

    1. the user you are querying has to have accepted the user_friends permission

    2. their friend who owns the photo in which the user is tagged has to also have accepted the user_photos & user_friends permission

    Therefore their friend also has to be using your app too :/

    P.S as for the "All of them but one have been uploaded by me" photo in the original test, this new information does not account for it. I don't know why it was returned but it could have been a bug. Who knows?