0
我正在使用FQL来确定用户是否喜欢发布。当用户不喜欢任何帖子时,回复是足够好的,但是当帖子被喜欢时它仍然是一样的,我没有得到用户的(我的)user_id
作为回应。Facebook Graph API/FQL来检查用户是否喜欢发布
这里就是我所做的:(授予块内得到read_stream
许可后)
NSURL *requestURL = [NSURL URLWithString:@"https://graph.facebook.com/fql"];
NSMutableDictionary * params = [NSMutableDictionary
dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"select user_id from like where object_id=%@ AND user_id=me()",postID], @"q", nil];
SLRequest *request = [SLRequest requestForServiceType:SLServiceTypeFacebook
requestMethod:SLRequestMethodGET
URL:requestURL
parameters:params];
request.account = [[self.accountStore accountsWithAccountType:accountTypeFacebook] objectAtIndex:0];
[request performRequestWithHandler:^(NSData *data,
NSHTTPURLResponse *response,
NSError *error) {
if(!error){
NSDictionary *resultDictionary = [[NSDictionary alloc] init];
resultDictionary = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:&error];
NSLog(@"dictionary with user id's: %@",resultDictionary);
}else{
//handle error gracefully
}
}];
输出(当后不喜欢):
{
data = (
);
}
输出(如果POST喜欢):
{
data = (
);
}
我试着通过帖子的id和在查询中使用post_id
我object_id
,但没有成功。