2

最新の Facebook フレームワーク 3.1 を使用して iOS アプリを作成しています。Facebook
ユーザーのウォールに画像やテキストを投稿することに関する多くのコンテンツを見てきました。次のコードを使用しています。

    NSDictionary* dict = @{
        @"link" : @"https://developers.facebook.com/ios",
        @"picture" : [UIImage imageNamed:@"Default"],
        @"message":@"Your temp message here",
        @"name" : @"MyApp",
        @"caption" : @"TestPost",
        @"description" : @"Integrating Facebook in ios"
    };
[FBRequestConnection startWithGraphPath:@"me/feed" parameters:dict HTTPMethod:@"POST" completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
    NSString *alertText;
    if (error)
    {
        NSLog(@"%@",[NSString stringWithFormat: @"error: domain = %@, code = %d", error.domain, error.code]);
        alertText = @"Failed to post to Facebook, try again";
    } else
    {
        alertText = @"Posted successfully to Facebook";
    }

    [[[UIAlertView alloc] initWithTitle:@"Facebook Result" message:alertText delegate:nil cancelButtonTitle:@"OK!" otherButtonTitles:nil] show];
}];

写真を「URL」として提供している場合、投稿は問題ありません。それ以外の場合は、エラーがスローされます。アプリバンドル内の画像を投稿したい。コーディングが間違っている場所を教えてもらえますか?

4

1 に答える 1