0

我想将包含图片的链接发布到 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"

有用。

4

1 回答 1

3

如果您阅读文档,它会说“图片”参数应该是字符串类型,即:url。如果没有一些巧妙的技巧,您无法同时发布来自移动 SDK 的图像和消息:请参阅文档中的我/照片,但您的选择受到严重限制。

于 2012-10-26T12:05:51.193 回答