Note that there are some explanatory texts on larger screens.

plurals
  1. POFacebook app stopped to post friends photos, after iOS 7 and SDK 3.10 update
    primarykey
    data
    text
    <p>I'm creating a simple iOS application that will take a picture, modify it and post it on some of your friends account. On a 'share' command the app will show the FB FriendPicker letting you select one of your friends.</p> <p>I had this working when I used iOS 6 and FB SDK ~3.7, the working code is below:</p> <pre><code>NSString* friendId; for (id&lt;FBGraphUser&gt; user in self.friendPickerController.selection) { friendId = user.id; } AppDelegate * appDelegate = (AppDelegate*) [ [UIApplication sharedApplication] delegate ]; UIImage *img = appDelegate.imageAnalyzed; NSMutableDictionary* params = [[NSMutableDictionary alloc] init]; [params setObject:@"Some message" forKey:@"message"]; [params setObject:UIImagePNGRepresentation(img) forKey: //@"source"]; //I tried all of them... @"image"]; //@"picture"]; [params setObject:@"true" forKey: @"fb:explicitly_shared"]; NSString* strId = [NSString stringWithFormat:@"%@/photos", friendId]; [FBRequestConnection startWithGraphPath: strId parameters:params HTTPMethod:@"POST" completionHandler:^(FBRequestConnection *connection, id result, NSError *error) { if (error) { //showing an alert for failure [self showAlert:@"Error posting photo." result:result error:error]; } else { [self performSegueWithIdentifier:@"goToAfterFBSegue" sender:self]; } }]; </code></pre> <p><strong>So here's the problem:</strong></p> <p>When I upgraded iOS to 7.0 and Facebook SDK to 3.10 then this code stopped working. But when I replace the:</p> <pre><code>NSString* strId = [NSString stringWithFormat:@"%@/photos", friendId]; </code></pre> <p>with:</p> <pre><code>NSString* strId = @"me/photos"; </code></pre> <p>it works and adds the picture to my account. I tried to find anything related to recent changes on FB but the official doc says that there weren't any functionality changes since then, only 'bug fixes'.</p> <p>I've also found another code example, that used <em>startForPostWithGraphPath</em> instead of <em>startWithGraphPath</em> like this:</p> <pre><code>NSMutableDictionary&lt;FBGraphObject&gt; *action = [FBGraphObject graphObject]; [action setObject:@"From Friendalizer:" forKey:@"message"]; [action setObject:UIImagePNGRepresentation(img) forKey: // @"source"]; @"image" ]; //@"picture"]; [FBRequestConnection startForPostWithGraphPath: @"me/myapp:post" graphObject:action completionHandler:^(FBRequestConnection *connection, id result, NSError *error) </code></pre> <p>And this code also gives me errors, the difference is that the error in first version is "com.facebook.sdk:ErrorSessionKey" with HTTPStatusCode 403, the second version returns HTTPStatusCode 400 :].</p> <p>Do you have any idea how to fix this issue?</p> <p>BTW: I understand it may be stupid or wrongly described question for some of you, but this is my very first iOS application and first FB app so I feel I'm going blind here...</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.
    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