我使用 Facebook 3.1 并尝试对特定帖子发表评论。我使用了以下代码。我在创建会话时也使用了下面提到的权限:
read_stream,offline_access,publish_stream,share_item
编码:
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"This is my comment", @"message", nil];
NSString *string=[NSString stringWithFormat:@"https://graph.facebook.com/153125724720582_184234384932460/comments?access_token=%@",appDelegate.session.accessToken];
[FBRequestConnection startWithGraphPath:string
parameters:params
HTTPMethod:@"GET"
completionHandler:^(FBRequestConnection *connection,
id result,
NSError *error) {
if (error) {
NSLog(@"Error: %@", [error localizedDescription]);
} else {
NSLog(@"Result: %@", result);
}
}];
Response :
Result: {
comments = 1;
id = "https://graph.facebook.com/153125724720582_184234384932460/comments";
}
但是我的消息没有在评论的帖子 ID 上更新。
我也尝试过与 Post 请求相同的代码,但响应是:
Result: {
"FACEBOOK_NON_JSON_RESULT" = false;
}