2014-01-07 74 views
0

我正在使用Facebook的SDK,需要分享详细信息Facebook时间表。我正在使用以下API调用。分享到Facebook墙

[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共享,但它可以很好地发布到用户的时间轴以及新闻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]; 
+0

那么,你想分享用户的时间表吗? – sathiamoorthy

+0

是的,使用SLComposeViewController共享的内容既出现在时间轴上,也出现在新闻提要中。我需要相同的功能 – iGo

+1

你有没有试过我的答案? http://stackoverflow.com/a/15217580/2629258否则,告诉我,我们可以尝试任何其他解决方案。 – sathiamoorthy

回答

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"。我希望这可以帮助你。

+0

您添加了评论,比如“您曾尝试过?”。它现在工作吗? – sathiamoorthy

+0

是的。但是在添加标签“fb:cleared_shared”之前。感谢很多 – iGo

+1

反正,最后它的工作。那很好。 – sathiamoorthy