facebook点赞数参数api V2.3
Parameter for like count with facebook api V2.3
我正在使用这行代码来计算 facebook 上的点赞数 post
NSString *postId = @"1234567890_1234567890";
NSMutableDictionary* photosParams = [NSMutableDictionary dictionaryWithObjectsAndKeys:postId,@"ObjectId",nil];
NSString * str = (NSString *) [[[FBSDKGraphRequest alloc] initWithGraphPath:@"/{object-id}/likes"
parameters:photosParams
HTTPMethod:@"GET"]
startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
if ([error.userInfo[FBSDKGraphRequestErrorGraphErrorCode] isEqual:@200]) {
NSLog(@"%@",[error localizedDescription]);
}
}];
但我收到不受支持的错误 url,任何人都知道我使用什么参数来获得结果。我正在使用更新版本的 facebook api
作为
状态,你需要
The same permissions required to view the parent object are required to view likes on that object.
这意味着帖子 (https://developers.facebook.com/docs/graph-api/reference/v2.3/post) 的权限设置适用:
- For page posts, public posts by the page are retrievable with any valid access token. Posts by people on the page, posts by people which mention the page, or targeted page posts (by language or geography, for example) may require a user or page token.
- A user access token with read_stream or user_posts permission for any other posts
您确定要向您的请求添加访问令牌吗?
您可以像这样一次请求多个帖子:
/?ids={object_id1},{object_id2}&fields=id,created_time,likes.summary(true).limit(0)
我正在使用这行代码来计算 facebook 上的点赞数 post
NSString *postId = @"1234567890_1234567890";
NSMutableDictionary* photosParams = [NSMutableDictionary dictionaryWithObjectsAndKeys:postId,@"ObjectId",nil];
NSString * str = (NSString *) [[[FBSDKGraphRequest alloc] initWithGraphPath:@"/{object-id}/likes"
parameters:photosParams
HTTPMethod:@"GET"]
startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
if ([error.userInfo[FBSDKGraphRequestErrorGraphErrorCode] isEqual:@200]) {
NSLog(@"%@",[error localizedDescription]);
}
}];
但我收到不受支持的错误 url,任何人都知道我使用什么参数来获得结果。我正在使用更新版本的 facebook api
作为
状态,你需要
The same permissions required to view the parent object are required to view likes on that object.
这意味着帖子 (https://developers.facebook.com/docs/graph-api/reference/v2.3/post) 的权限设置适用:
- For page posts, public posts by the page are retrievable with any valid access token. Posts by people on the page, posts by people which mention the page, or targeted page posts (by language or geography, for example) may require a user or page token.
- A user access token with read_stream or user_posts permission for any other posts
您确定要向您的请求添加访问令牌吗?
您可以像这样一次请求多个帖子:
/?ids={object_id1},{object_id2}&fields=id,created_time,likes.summary(true).limit(0)