0

I want to retrieve the status data posted/published by friends of a user. I wrote the following code, but only get the user's own status updates. Could someone please help to tell me what's wrong with my code? Thanks!

NSString *fql = [NSString stringWithFormat:@"select uid,message from status where uid in (select uid2 from friend where uid1=%lld) order by time desc ", uid];

NSDictionary *params = [NSDictionary dictionaryWithObject:fql forKey:@"query"];
[[FBRequest requestWithDelegate:self] call:@"facebook.Status.get" params:params];  
4

1 回答 1

1

您需要更改调用以使用“facebook.fql.query”,因为您正在进行直接查询。

这是我获取最近 20 个朋友更新的代码:

NSString* fql = [NSString stringWithFormat:
                 @"SELECT uid, pic_square, name, status FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = %lld) AND status.time > 0 ORDER BY status.time DESC LIMIT 20", fbSession.uid];

NSDictionary* params = [NSDictionary dictionaryWithObject:fql forKey:@"query"];
last20FriendsStatusRequest = [FBRequest requestWithDelegate:self];
[last20FriendsStatusRequest call:@"facebook.fql.query" params:params];

此致,

于 2010-02-02T23:49:29.340 回答