2012-12-11 142 views
-1

我正在使用下面的代码发布在设备用户的墙上。我也设法得到朋友名单和他们的ID。使用朋友的ID如何根据朋友的ID使用以下代码发布在选定的朋友的墙上?如何发布在朋友的墙上?

if([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) { 
    SLComposeViewController *controller = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook ]; 
    SLComposeViewControllerCompletionHandler myBlock = ^(SLComposeViewControllerResult result) { 
     if (result == SLComposeViewControllerResultCancelled) { 
      NSLog(@"Cancelled"); 

     } else { 
      UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Posted!!!" 
      message:@"your status is posted to facebook successfully" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];     
      [alert show]; 
     } 

     [controller dismissViewControllerAnimated:YES completion:Nil]; 
    }; 

    controller.completionHandler =myBlock; 

    [controller setInitialText:@" hello there you got a text ..."]; 

    [self presentViewController:controller animated:YES completion:Nil]; 
} 
+0

这一点已经在这里找到答案:http://stackoverflow.com/questions/4126400/api-facebook- iphone,可能到后期至A-朋友墙 – Anton

回答

0

发布到其他用户墙是截至2013年2月6日,已弃用。

https://developers.facebook.com/roadmap/completed-changes/

删除通过图形API张贴到墙上朋友

我们将删除通过图形API张贴到用户的朋友的墙壁的能力的能力。具体而言,针对[user_id]/feed其中[user_id]不同于会话用户的帖子,或者target_id用户与会话用户不同的stream.publish调用将失败。如果您想允许用户发布到朋友的时间表,请调用提要对话框。通过用户提及标签或动作标签的朋友的故事将显示在朋友的时间轴上(假设朋友认可标签)。欲了解更多信息,请参阅此博客文章。

相关问题