Note that there are some explanatory texts on larger screens.

plurals
  1. POiOS facebook sdk how to download album, profile photos data
    primarykey
    data
    text
    <p>I would like to allow my iPhone App users to view and select from their facebook profile photos, download the photo to use as a profile pic. I am currently using the Facebook SSO SDK and successfully logging in and accessing Graph information. Have tried to access photo information (after successful SSO login) using </p> <pre><code>[facebook requestWithGraphPath:@"me/albums"]; </code></pre> <p>but I just get an empty data object in return. I've tried using the <a href="https://developers.facebook.com/tools/explorer" rel="nofollow noreferrer">Facebook API explorer</a>, which is very helpful, and it does give me data for /picture and /photos and /albums. For some reason I don't get the same data using requestWithGraphPath with me/albums, me/picture or me/photos. Just plain "me" works fine but doesn't give me any picture info. Can anybody tell me what I'm doing wrong?</p> <p>Note: this is the API reference: <a href="https://developers.facebook.com/docs/reference/api/user/" rel="nofollow noreferrer">Facebook Graph API</a></p> <p>I did get picture profile to work like this:</p> <pre><code>[facebook requestWithGraphPath:@"me?fields=picture"]; </code></pre> <p>Update: really I want all of the Profile Photos which is a photo album so I need to know how to access albums through iOS. The profile picture I have successfully obtained now.</p> <p>I have added permissions "user_photos" and "friends_photos" for photo albums according to API:</p> <pre><code> NSArray *permissions = [[NSArray alloc] initWithObjects: @"user_likes", @"user_birthday", @"email", @"publish_stream", @"publish_actions", @"user_photos", @"friends_photos", nil]; [facebook authorize:permissions]; </code></pre> <p>When I say I'm getting empty data, this is the JSON result (in request:didLoad:) that gets returned:</p> <pre><code> { data = ( ); } </code></pre> <p>From my log file output:</p> <pre><code>- (void) request:(FBRequest *)request didLoad:(id)result{ NSLog(@"%@",result); } </code></pre> <p>Final Note: What finally worked was to use another device, which updated my permissions and then everything started working! My best guess is that the emulator and my iPhone were not updating my facebook permissions so I was being denied access to photos and getting an empty data array.</p> <p>This SO question was a big help also: <a href="https://stackoverflow.com/questions/4921945/how-to-get-photos-of-a-facebook-album-in-iphone-sdk?rq=1">How to get photos of a facebook album in iPhone SDK?</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload