0
votes

I need to fetch public posts of given type from a Facebook wall and I can't figure out the easiest way. Can I use the Facebook API for this without the need to login the user? Thanks.

2

2 Answers

2
votes

If the posts are public you can scan them with a RSSReader. I wrote my own for this purpose.

This is how I get the Feed URL: http://findmyfacebookid.com/

Edit: If you’re fairly new to iOS development writing an RSSReader is an excellent exercise. You establish connections, parse strings, fill different data structures and probably create your first delegation protocol. If you’re in a hurry, take a look at these Github repositories: SimpleRSSReader, RSSReader

A suggestion on how to approach this:

  1. Read this Wikipedia Article about RSS. Facebook uses RSS 2.0, so take a closer look at the "RSS compared to Atom" section.

  2. Create your RSSReader class (RSSEntry class) and create the data structure. (Compare to #1)

  3. Established a connection to a very simple RSSFeed url (Use a simple blog). (The AFNetworking Framework is worth a look)

  4. Parse the input data and fill your data structures (Take a look at #1 for this)

  5. When finished, call your delegate class and do something with your data.

1
votes
  • You can fetch public post without login in Facebok. For get feeds of any user, you must need access token. Public feeds take any valid access token, application tokens can be used.

  • Set your app up in Facebook and it will give you an app id and an API key. Get the profile id for the public page feed you want, and that's all you need.

  • Just replace PROFILE ID OR NAME and APPID and SECRETKEY values in below URL and you would get your desired result in JSON from Facebook

    https://graph.facebook.com/PROFILE ID OR NAME/feed?access_token=APPID|SECRETKEY