-1

I have used the Graph API, and have successfully logged in to Facebook and gotten the friends list.

Now I need to post a message on the wall. How?

jscs
  • 63,694
  • 13
  • 151
  • 195
Ranga
  • 821
  • 4
  • 11
  • 20
  • you mean to a friend wall .. or your wall ? – Malek_Jundi May 02 '12 at 09:20
  • possible duplicate of [How to post to a friends Wall using Facebook Graph API for iPhone](http://stackoverflow.com/questions/4614920/how-to-post-to-a-friends-wall-using-facebook-graph-api-for-iphone) – jscs May 02 '12 at 18:22

4 Answers4

1

use the url for posting on wall and use this method for post on wall

- (void)postToWall 
{

FBStreamDialog *dialog = [[[FBStreamDialog alloc] init] autorelease];
dialog.userMessagePrompt = @"Enter your message:";
dialog.attachment = [NSString stringWithFormat:@"{\"name\":\"Facebook Connect for iPhone\",\"href\":\"http://developers.facebook.com/connect.php?tab=iphone\",\"caption\":\"Caption\",\"description\":\"Description\",\"media\":[{\"type\":\"image\",\"src\":\"http://img40.yfrog.com/img40/5914/iphoneconnectbtn.jpg\",\"href\":\"http://developers.facebook.com/connect.php?tab=iphone/\"}],\"properties\":{\"another link\":{\"text\":\"Facebook home page\",\"href\":\"http://www.facebook.com\"}}}"];
[dialog show];
}
vishiphone
  • 750
  • 7
  • 14
0

You can also learn how to publish wall and other essential practice for iOS Facebook Development from the demo that official published by facebook "Hackbook for iOS"

Sakares
  • 606
  • 12
  • 31
0

NSMutableDictionary *variables = [NSMutableDictionary dictionaryWithCapacity:1];

[variables setObject:@"this is a test message: postMeFeedButtonPressed" forKey:@"message"];

FbGraphResponse *fb_graph_response = [fbGraph doGraphPost:@"yourFriendFbID/feed" withPostVars:variables];

SBJSON *parser = [[SBJSON alloc] init];
NSDictionary *facebook_response = [parser objectWithString:fb_graph_response.htmlResponse error:nil];   
[parser release];
0

if you want to post to your wall thought your FB app without showing a dialog you could do it like this

NSString *message = @"some text";
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:message, @"message",nil];                          
[fb requestWithGraphPath:@"me/feed" andParams:params andHttpMethod:@"POST" andDelegate:self]; //fb here is the FaceBook instance.

and for sure you will do that after the user login and authorized the permissions .

Malek_Jundi
  • 6,140
  • 2
  • 27
  • 36