ryanscott / bamboo

a lightweight, simple objective-c library implementation of facebook's graph api, for the iPhone.
Other
39 stars 2 forks source link

Reading the user Wall (feeds) #5

Open ghost opened 14 years ago

ghost commented 14 years ago

Hallo, I'm trying to write an application for the iPhone. I don't know which function should I use to get the wall of the user. Which would be the equivalent of calling for example:

http://graph.facebook.com/me/feed http://graph.facebook.com/1722181189/feed

I thought it would be something like:

GraphObject *o = [self._graph getObject:@"1722181189" withArgs:[NSDictionary dictionaryWithObjectsAndKeys:@"feed", @"feed", nil]];

But I see no point of using a Dictionary here when I want to get the feed. Is this the correct function to get te Wall info? How am I suposed to use the Dictionary parameter?

Thanks.

ryanscott commented 14 years ago

What you want is something like this:

GraphObject* me = [self._graph getObject:@"me"];
NSArray* feed = [self._graph getConnections:@"feed" forObject:me.objectID];

The feed is not an object proper in the semantics of the graph, it is a connection type of an object node. In the syntax of Bamboo, this is represented by the getConnections method, which basically just calls a url with "object/connection"

I created constants for all of the valid connection types, which you can see at the bottom of GraphAPI.h...but if you know the API name, you can just as well use the string directly.