0

I am working on an application on facebook integration using fbgraph api.I have downloaded sample application from this link oAuth2Test and then changed client_id.While post on me it is working fine but I don't know how to post on a friends wall or if this is possible.

Or at least to send his friends a message.

Can anyone give me a clue?

Thank you!

posting me working fine

-(IBAction)postMeFeedButtonPressed:(id)sender {

NSMutableDictionary *variables = [NSMutableDictionary dictionaryWithCapacity:4];

[variables setObject:@"this is a test message: postMeFeedButtonPressed" forKey:@"message"];
[variables setObject:@"http://bit.ly/bFTnqd" forKey:@"link"];
[variables setObject:@"This is the bolded copy next to the image" forKey:@"name"];
[variables setObject:@"This is the plain text copy next to the image.  All work and no play makes Jack a dull boy." forKey:@"description"];

FbGraphResponse *fb_graph_response = [fbGraph doGraphPost:@"me/feed" withPostVars:variables];
NSLog(@"postMeFeedButtonPressed:  %@", fb_graph_response.htmlResponse);

//parse our json
SBJSON *parser = [[SBJSON alloc] init];
NSDictionary *facebook_response = [parser objectWithString:fb_graph_response.htmlResponse error:nil];   
[parser release];

//let's save the 'id' Facebook gives us so we can delete it if the user presses the 'delete /me/feed button'
self.feedPostId = (NSString *)[facebook_response objectForKey:@"id"];
NSLog(@"feedPostId, %@", feedPostId);
NSLog(@"Now log into Facebook and look at your profile...");

}
Ravindhiran
  • 5,304
  • 9
  • 50
  • 82
  • @AnveshSaxena how can i identify who are authorized users with the help of Graph api? – Ravindhiran Dec 21 '13 at 07:42
  • You can check `/permissions` end point on a `user` to check whether the user has authorized your application to post on his behalf or not. – Anvesh Saxena Dec 22 '13 at 08:59
  • 1
    You can no longer post directly to a friend's wall using the graph API. The only way to post to a friend's wall now is by using the Feed Dialog. – Ming Li Dec 23 '13 at 18:44

0 Answers0