我想在Facebook时间轴上发布包含图片的链接:
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];
}];
UIImage没有发布。你能救我吗?
但是,如果我使用:
@"https://developers.facebook.com/attachment/iossdk_logo.png", @"picture"
它有效。
答案 0 :(得分:3)
如果您阅读the documentation,则说“picture”参数应为string类型,即:url。如果没有一些聪明的hackory,您无法同时发布移动SDK中的图像和消息:请参阅文档中的我/照片,但您的选项受到严格限制。