ページウォールに画像を投稿したいのですが、画像をアルバムやユーザーフィードに投稿する方法は知っていますが、ページにはいくつかの問題があります
私は FBGraph API を使用しており、Facebook ページに写真をアップロードしたいのですが、チュートリアルまたはコード ベースへのリンクを提供してください。
現在、投稿したすべての画像は、投稿したいページではなく、ウォールに表示されています。
以下のコードを使用しました
-(void)postPictureToWall { NSMutableDictionary *variables = [[NSMutableDictionary alloc] init]; // FbGraphFile オブジェクト インスタンスを作成し、公開する画像を設定します UIImage *frontImageNew=self.imgvgalleryImage.image; FbGraphFile *graph_file = [[FbGraphFile alloc] initWithImage:frontImageNew]; //最後に、変数ディクショナリに FbGraphFile オブジェクトを設定します.... [変数 setObject:graph_file forKey:@"file"]; NSDateFormatter *df = [[NSDateFormatter alloc]init]; [df setDateStyle:NSDateFormatterMediumStyle]; [df setTimeStyle:NSDateFormatterMediumStyle]; NSString *bodyString=[NSString stringWithFormat:@"%@",[df stringFromDate:[NSDate 日付]]]; [変数 setObject:bodyString forKey:@"メッセージ"]; FbGraphResponse *fb_graph_response = [objFBGraph doGraphPost:@"pageid_here/feed" withPostVars:変数]; SBJSON *parser = [[SBJSON alloc] init]; NSDictionary *facebook_response = [パーサー objectWithString:fb_graph_response.htmlResponse エラー:nil]; NSLog(@"fb 応答 = %@",facebook_response); }
上記のコードを使用して、ページウォールにテキストを正常に投稿していますが、画像は投稿していません