发布在Facebook页面上

时间:2012-10-19 15:35:03

标签: ios5 xcode4.3

我正在使用此代码在Facebook页面上发布任何文本,并在代码中显示页面ID。它给出了成功的消息但是当我转到页面时什么也没有。 请帮忙......

提前致谢

-(void)facebookPost;

{     NSMutableDictionary * variables = [NSMutableDictionary dictionaryWithCapacity:2];     FbGraphFile * graph_file = [[FbGraphFile alloc] init]; // initWithImage:[UIImage imageNamed:@“gg”]];     //最后,将FbGraphFileobject设置为我们的变量字典....     [变量setObject:graph_file forKey:@“file”];

[variables setObject:@"hihihi" forKey:@"message"];
FbGraphResponse *fb_graph_response = [fbGraph doGraphPost:[NSString stringWithFormat:@"%@/167884363345570/feed",FACEBOOK_APP_KEY] withPostVars:variables];

FbGraphResponse * fb_graph_response = [fbGraph doGraphPost:[NSString stringWithFormat:@“%@ / 167884363345570 / feed”,FACEBOOK_APP_KEY] withPostVars:variables];

}

1 个答案:

答案 0 :(得分:0)

错误就在这一行......

<强>错误:

FbGraphResponse *fb_graph_response = [fbGraph doGraphPost:[NSString stringWithFormat:@"%@/167884363345570/feed",FACEBOOK_APP_KEY] withPostVars:variables];

正确的方法是这样:

FbGraphResponse *fb_graph_response = [fbGraph doGraphPost:[NSString stringWithFormat:@"167884363345570/feed"] withPostVars:variables];

我已经解决了这个问题。