开发者

Retrieve news feed using facebook API

Hi I have been looking for hours but cannot find the API call that retrieves a user's news feed (i.e the thing that you see at http://www.facebook.com/home.php). I think this should开发者_JAVA技巧 be something extremely easy. What did I miss?

I would prefer an answer with FQL, but other API methods will be just fine, as I think I can translate between them.


https://graph.facebook.com/me/home

Note: /me/home retrieves an outdated view of the News Feed. This is currently a known issue and we (Facebook) don't have any near term plans to bring them back up into parity.


I found it! The way is to look in the stream for post from users that are your friends. This is kind of annoying because it takes double the effort just to do some very basic task. In Objective-C using FBConnect the code look like this:

NSString *connections = [NSString stringWithFormat:@"select target_id from connection where source_id == %lld", _uid];
NSString *fql = [NSString stringWithFormat:@"select message from stream where source_id in (%@)", connections];
NSDictionary* params = [NSDictionary dictionaryWithObject:fql forKey:@"query"];
[[FBRequest requestWithDelegate:self] call:@"facebook.fql.query" params:params];


http://developers.facebook.com/docs/reference/fql/stream

the first example is how to properly get the news feed.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜