iosfacebook-graph-apipostfacebook-ios-sdkfbconnect

Post to user's Facebook wall with iPhone using latest FBConnect SDK


I'm having a tough time finding any good documentation for the FBConnect iPhone SDK. I have the SDK set up to get the permissions from the user but making a simple post is escaping me. All I can find is documentation for the PHP web SDK.

Can anybody point me to some documentation for the iPhone SDK or let me know how I can post to a users wall using the latest graph FBConnect SDK?

Thanks!


Solution

  • Have you looked at DemoApp under the sample directory in facebook-ios-sdk? There's a publishStream method that might help.

    Or, you can use

    - (void)requestWithGraphPath:(NSString *)graphPath
                       andParams:(NSMutableDictionary *)params
                   andHttpMethod:(NSString *)httpMethod
                     andDelegate:(id <FBRequestDelegate>)delegate;
    

    like this:

    [_facebook requestWithGraphPath:@"[user_id]/feed" 
                          andParams:[NSMutableDictionary dictionaryWithObject:@"test wall post" forKey:@"message"]
                      andHttpMethod:@"POST"
                        andDelegate:self];
    

    to post a comment to [user_id]'s wall.