分享到Facebook Wall

时间:2014-01-07 09:39:59

标签: ios facebook facebook-graph-api facebook-ios-sdk

我正在使用facebook sdk并需要与Facebook时间线分享详细信息。我正在使用以下api调用。

  [FBRequestConnection startWithGraphPath:@"/feed"
                             parameters:dictionary
                             HTTPMethod:@"POST"
                      completionHandler:^(FBRequestConnection *connection,
                                          id result,
                                          NSError *error)
 {
     if (!error) {
          [VBUtility showAlertWithTitle:@"Facebook" message:@"Deal details posted successfully"];
     }
 }];

故事发布在Facebook上,而不是用户的时间线上,而是用户的新闻源(该文档告诉此方法确实 - 此人或其他人在其个人资料中发布的帖子和链接。)。我也试过/ home方法调用。虽然我尝试使用内置的facebook分享,

SLComposeViewController *fbPost = [SLComposeViewController
                                   composeViewControllerForServiceType:SLServiceTypeFacebook];

它完美地发布到用户的时间轴和新闻Feed中。我已在developer.facebook.com中配置了该应用程序。我需要在这里提及任何权限吗?有人能帮我找错吗? 许可请求,

 NSArray *permissions = [[NSArray alloc]initWithObjects:@"publish_actions",@"user_birthday",@"publish_stream",@"user_about_me",@"email",@"basic_info",nil];

传递的参数是

NSMutableDictionary *dictionary = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                                   app_id, @"app_id",
                                                   name,@"name",
                                                   caption, @"caption",
                                                   description,@"description",
                                                   link, @"link",
                                                   picture, @"picture",
                                                   @"1",@"fb:explicitly_shared",
                                                   nil];

1 个答案:

答案 0 :(得分:1)

试试这个,

 [FBRequestConnection startWithGraphPath:@"me/feed"
                             parameters:dictionary
                             HTTPMethod:@"POST"
                      completionHandler:^(FBRequestConnection *connection,
                                          id result,
                                          NSError *error)
 {
     if (!error) {
          [VBUtility showAlertWithTitle:@"Facebook" message:@"Deal details posted successfully"];
     }
 }];

我改变了你的代码。将您的路径更改为@"me/feed"。我希望,这可能会对你有帮助。