Reputation: 1254
I'm trying to generate a story object and post it to facebook using facebook share dialog. it works well with only one issue:
i'm trying to use an UIImage instead of image url.
when the share dialog is opened, i can see the image selected by the user. after posting, i can see on facebook.com site an image from my site.com instead of the UIImage i sent.
Any ideas ?
NSMutableDictionary<FBGraphObject> *object =
[FBGraphObject openGraphObjectForPostWithType:@"name_app:artwork"
title:@"User generated content"
image:self.artworkImage
url:self.myAppWebSiteUrl
description:@""];;
id<FBOpenGraphAction> action = (id<FBOpenGraphAction>)[FBGraphObject graphObject];
action[@"artwork"] = object;
if ( [FBDialogs canPresentShareDialogWithOpenGraphActionParams:action]) {
[FBDialogs presentShareDialogWithOpenGraphAction:action
actionType:@"name_app:contribute"
previewPropertyName:@"artwork"
handler:^(FBAppCall *call, NSDictionary *results, NSError *error) {
[self close];
if(error) {
NSLog(@"Error: %@", error.description);
} else {
NSLog(@"Success");
}
}];
}
Upvotes: 1
Views: 434
Reputation: 1216
I believe your self.artworkImage
associated to the object's image
parameter is used as a thumbnail to the url
. If I understood correctly you want to send the UIImage
as a part of the story - in that case you should assign your UIImage to the action's image
object. Check this link for how to append local images to your story.
Let me know if it helped you.
Upvotes: 1