我想将图像发布在页面墙上,并且我知道如何将图像发布到相册和用户提要上,但是对于页面它会给出一些问题
我正在使用 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 date]]];
[变量 setObject:bodyString forKey:@"message"];
FbGraphResponse *fb_graph_response = [objFBGraph doGraphPost:@"pageid_here/feed" withPostVars:variables];
SBJSON *parser = [[SBJSON alloc] init];
NSDictionary *facebook_response = [parser objectWithString:fb_graph_response.htmlResponse error:nil];
NSLog(@"fb 响应 = %@",facebook_response);
}
我正在使用上面的代码在页面墙上成功发布文本但不是图像