【问题标题】:How do I post on friends' walls?如何在朋友的墙上发帖?
【发布时间】:2012-12-11 13:05:55
【问题描述】:

我正在使用以下代码在设备用户的墙上发帖。我也设法获得了朋友列表和他们的 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];
}

【问题讨论】:

标签: iphone objective-c ios facebook ios6


【解决方案1】:

看看安东向您指出的问题。 但是,据我了解,Facebook 将是removing the ability to post to a friends wall using the Graph API in February 2013。相反,您需要通过调用 Feed 对话框并在帖子中标记朋友来创建帖子。然后该帖子将出现在他们的墙上(假设他们批准)。在决定如何处理时,您需要牢记这一点。

【讨论】:

    【解决方案2】:

    自 2013 年 2 月 6 日起,向其他用户发布信息墙已弃用。

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

    移除通过 Graph API 向朋友墙发帖的功能

    我们将取消通过 Graph API 在用户朋友的墙上发帖的功能。具体来说,针对 [user_id]/feed 的 [user_id] 与会话用户不同的帖子,或 target_id 用户与会话用户不同的 stream.publish 调用将失败。如果您想允许人们发布到他们朋友的时间线,请调用提要对话框。通过用户提及标记或动作标记包含朋友的故事将显示在朋友的时间线上(假设朋友批准标签)。有关详细信息,请参阅此博文。

    【讨论】:

      【解决方案3】:

      你不能从API发到朋友的墙,但可以发布到他们的Stream

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多