开发者

iphone facebook user's friends status updates

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:@"开发者_StackOverflow中文版query"];
[[FBRequest requestWithDelegate:self] call:@"facebook.Status.get" params:params];  


You need to change the call to use "facebook.fql.query" since you're doing a direct query.

Here's my code for getting the last 20 friends updates:

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];

Best regards,

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜