Question

I'm trying to integrate a custom view which shows a few post of the users Facebook news feed.

I'm looking for a good starting point. I don't want to use a UIWebView or something like this to grab the mobile site of Facebook instead I want to get data in JSON format or similar and display it in a custom fashion.

Can you give me any advice or links to tutorials how i can get the Facebook news feed data?

Edit: I want to update my requirements. I looked a bit into the Facebook Documentation and the SDK. There are some Sample Codes which are useful but I'm missing a straight forward tutorial or sample which does fetch the users newsfeed and displays it. This is why I made the bounty.

I will give the +100 Rep for somebody that creates a sample or tutorial which does get posts of the users newsfeed. Required would be: Get the name of the poster, message, timestamp and attached image. It would be nice if you also show them in a uiview but it is not required. If there is an existing framework feel free to link it.

I'm working myself on something similar and will publish it too. I think this could be tribute to the community.

Was it helpful?

Solution

I have created a sample starter project that gets the user's facebook newsfeed and displays it. It shows who did the post, the poster's profile picture, and when it was posted along with the message.

It is fairly rudimentary and could use some enhancement from other developers, i.e. endless scrolling, displaying any links, likes or recognizing URLs, etc.

https://github.com/AaronBratcher/UserFeed

OTHER TIPS

I would integrate the Facebook API on my project, and then you can have access of many informations available on Facebook.

A good start point is read the documentation that you can find here: https://developers.facebook.com

It's not hard to understand, but it has a lot of information!

Good luck.

At first, you need "read_stream" permission for your app. Then read Facebook Query Language (FQL) Reference https://developers.facebook.com/docs/reference/fql/

To get the Newsfeed you can use the following code:

NSString *fqlString = @"SELECT * FROM stream WHERE filter_key IN (SELECT filter_key FROM stream_filter WHERE uid=me() AND type='newsfeed') AND is_hidden=0 LIMIT <YOUR_LIMIT>";

[FBRequestConnection startWithGraphPath:@"/fql"
                     parameters: @{@"q": fqlString}
                     HTTPMethod:@"GET"
                     completionHandler:^(FBRequestConnection *connection, id result, NSError *error) 
                     {
                          <ANALYZE RESPONSE>
                     }];
  1. Facebook API / SDK Request Wrapper
  2. News feed post class
  3. Simple UI to test the code

Getting Started:

facebook-sdk-posting-to-user-news-feed

Sample App

To my knowledge you cannot obtain News Feed data in your application. stream table shows only the posts that have appeared on your wall. To create a News Feed for a user Facebook uses his own private algorithm (it was Facebook Edgerank, but read that recently they had changed this algorithm to a new one).

To my point of view, to achieve your goal you can crawl data of all your friends and try to create an algorithm that will range these posts similar to the way it is done by Facebook.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top