Image not loaded when posting story using Facebook SDK for iOS

I am following the official FB tutorial for posting stories using the share dialog:

https://developers.facebook.com/docs/ios/open-graph#sharedialog

I have already configured my facebook app and I have set up the correct capabilities for this action (exactly as described in the tutorial). I checked each step twice and three times.

The story has been published, but the image does not appear in the post. When the sharing dialog appears, a thumbnail image of the image is displayed, then I click Message and I see the progress bar that indicates uploading, but at the end I get a message with no image.

I downloaded the source code of the tutorial applications, compiled it and got the same result ( https://github.com/fbsamples/ios-howtos/tree/master/FBOGSampleSD ).

+3


source to share


1 answer


It looks like it is probably related to this bug: https://developers.facebook.com/bugs/456750217796696/

It has been fixed, but I don't think the update has been released yet.



One thing you could do at the same time is to upload an image to Facebook staging servers from your app before sending that action to the share dialog, but that will force you to get post permissions from the user through your app, which, admittedly, "Great, but at least get your images out there."

[FBRequestConnection startForUploadStagingResourceWithImage:image completionHandler:^(FBRequestConnection* connection, id result, NSError* error) {
    if(!error)
    {
        [newImageInfo setObject: [result objectForKey:@"uri"] forKey: @"url"];
        [fbObject setObject: @[newImageInfo] forKey: @"image"];

        // Setup action with fbObject property, then send action to native Share Dialog
    }
    else
    {
        NSLog(@"[ERROR] Could Not Stage Image: %@", error.description);
    }
}];

      

+1


source







All Articles