如何使用Facebook Graph API发布给朋友Wall

时间:2013-12-21 06:14:29

标签: ios facebook facebook-graph-api

我正在使用fbgraph api处理facebook集成的应用程序。我已从此链接oAuth2Test下载了示例应用程序然后更改了client_id.While帖子对我说它工作正常但我不知道如何在朋友的墙上张贴或者如果可能的话。

或至少向他的朋友发送消息。

有人能给我一些线索吗?

谢谢!

让我工作正常

-(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...");

}

0 个答案:

没有答案