in a class that implements FBSessionDelegate and FBRequestDelegate , you should call the following:
Facebook *_facebook = [[Facebook alloc] initWithAppId:kAppId]; NSArray *_permissions = [[NSArray arrayWithObjects: @"read_stream", @"offline_access",nil] retain]; [_facebook authorize:_permissions delegate:self];
And this is the call for the fb message (should be used in the same class):
NSString *message = @"This is the message I want to post"; NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys: message, @"message", nil]; [_facebook requestWithMethodName:@"stream.publish" andParams:params andHttpMethod:@"POST" andDelegate:self];
If you want to post on another user's wall, you must include the "uid" parameter in the params dictionary. Please refer to http://developers.facebook.com/docs/reference/rest/stream.publish/
PS There are all the necessary examples in the iPhone Facebook to connect the SDK code example, so please do not be afraid to investigate a little bit ;)
source share