您可以像这样获取评论的第一页:
NSDictionary *params = @[@"ids" : pageId];
self.connection =
[FBRequestConnection
startWithGraphPath:@"comments"
parameters:params
HTTPMethod:@"GET"
completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
// ...
}];
其中 pageId 是包含社交插件的网页的 URL。评论以 JSON 形式返回。此响应包含一个用于获取下一页的 URL,您可以像这样获取它:
FBRequest *fbRequest = [[FBRequest alloc] initWithSession:[FBSession activeSession]
graphPath:nil];
FBRequestConnection *connection = [[FBRequestConnection alloc] init];
[connection addRequest:fbRequest completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
// ...
}];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:moreCommentsURL];
connection.urlRequest = request;
[connection start];
您必须构建自己的解决方案来显示这些评论。