Search code examples
iosobjective-cfacebookfacebook-graph-apifacebook-ios-sdk

Facebook iOS SDK , share an image with a caption using ShareDialog (not GraphAPI)


I'm using following code to share a picture to Facebook using ShareDialog. However I'm unable to set a caption to this. params does not have a property for a caption.

 FBPhotoParams *params = [[FBPhotoParams alloc] init];

        params.photos = @[image]; // this is an UIImage instance.


        [FBDialogs presentShareDialogWithPhotoParams:params
                                         clientState:nil
                                             handler:^(FBAppCall *call,
                                                       NSDictionary *results,
                                                       NSError *error) {
                                                 if (error) {
                                                     NSLog(@"Error: %@",
                                                           error.description);
                                                 } else {
                                                     NSLog(@"Success!");
                                                 }
                                             }];

However there's a different method to share a status update with a picture, but this methods allows to share an image as a web link.

presentMessageDialogWithLink:name:caption:description:picture:clientState:handler:

I want to share a local UIImage just like in my first approach, with a caption. Is this possible?


Solution

  • There's no support for captions via the photo share dialog. The user must type in the caption/message themselves.