I want to post a link including an image to Facebook timeline:
UIImage *img = [UIImage imageNamed:@"1.png"];
self.postParams =
[[NSMutableDictionary alloc] initWithObjectsAndKeys:
@"Here we go", @"message",
@"https://developers.facebook.com/ios", @"link",
UIImagePNGRepresentation(img), @"picture",
@"Facebook SDK for iOS", @"name",
@"Build great social apps and get more installs.", @"caption",
@"The Facebook SDK for iOS makes it easier and faster to develop Facebook integrated iOS apps.", @"description",
nil];
[FBRequestConnection startWithGraphPath:@"me/feed" parameters:self.postParams HTTPMethod:@"POST"
completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
[self showAlert:@"Link is posted" result:result error:error];
}];
The UIImage does not posted. Can you help me?
But simply if I use :
@"https://developers.facebook.com/attachment/iossdk_logo.png", @"picture"
it works.
If you read the documentation, it says the “picture” parameter should be of type string ie: a url. You can not post an image and a message from the mobile SDKs at the same time without some clever hackory: see me/photos in the documentation but your options are severely limited.