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

ドキュメントを読むと、「picture」パラメーターは文字列型、つまり URL である必要があると書かれています。モバイル SDK から画像とメッセージを同時に投稿するには、巧妙なハッコリーが必要です。ドキュメントの me/photos を参照してください。ただし、オプションは非常に限られています。

于 2012-10-26T12:05:51.193 に答える