Iphone 在Facebook上发布一个包含UIImage的链接
我想发布一个链接,包括Facebook时间线的图片:Iphone 在Facebook上发布一个包含UIImage的链接,iphone,objective-c,ios,facebook,Iphone,Objective C,Ios,Facebook,我想发布一个链接,包括Facebook时间线的图片: UIImage *img = [UIImage imageNamed:@"1.png"]; self.postParams = [[NSMutableDictionary alloc] initWithObjectsAndKeys: @"Here we go", @"message", @"https://developers.facebook.com/ios", @"link", UIImage
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"
它可以工作。如果您阅读,它会说“picture”参数应该是string类型,即url。如果没有一些巧妙的技巧,您无法同时发布来自移动SDK的图像和消息:请参阅文档中的“我/照片”,但您的选项非常有限。如果您阅读,它会说“图片”参数应为字符串类型,即url。如果没有一些巧妙的技巧,您无法同时发布来自移动SDK的图像和消息:请参见文档中的“我/照片”,但您的选择非常有限。您完全正确。如果我从UIImage创建一个URL,然后在参数中使用该字符串,会怎么样?是的,如果您按照文档中的说明操作,它通常会起作用,您是完全正确的。如果我从UIImage创建一个URL,然后在参数中使用该字符串,会怎么样?是的,如果您按照文档中的说明操作,它通常会起作用