I use Facebook 3.1 and try comment on a particular post. I have used the following code. I have used the below mentioned permissions also while creating session:
read_stream,offline_access,publish_stream,share_item
The code:
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";
}
But my message is not updated on commented post id.
Same code with Post request also I have tried but Response is:
Result: {
"FACEBOOK_NON_JSON_RESULT" = false;
}
You should use an HTTP POST and make sure that the user has granted
publish_streampermissions.You should copy and paste the API call (and the access token) into the Graph Explorer to test your call out.
(Also use the access_token debugger to make sure the permission is there)