张贴在朋友墙壁在facebook与图表api

时间:2014-03-07 09:38:34

标签: ios facebook facebook-graph-api

我已按照此link发布在Facebook上的朋友圈:

这是我的代码:

    FBRequest *request = [FBRequest requestWithGraphPath:@"FRIEND_ID/feed" parameters:[NSMutableDictionary dictionaryWithObject:@"Post on wall" forKey:@"message"] HTTPMethod:@"POST"];

[request startWithCompletionHandler:^(FBRequestConnection *connection,id result, NSError *error){
    NSLog(@" result : %@",result);

}];

我拥有以下用户的权限:

(
    "create_note",
    "basic_info",
    "share_item",
    "status_update",
    "user_photos",
    "publish_actions",
    "user_friends",
    "publish_checkins",
    "video_upload",
    "publish_stream",
    "photo_upload",
    installed,
    email,
    "public_profile",
    "user_birthday",
    "user_location",
    "friends_birthday",
    "friends_photos"
)

但收到错误消息如下:

Error Domain=com.facebook.sdk Code=5 "The operation couldn’t be completed. (com.facebook.sdk error 5.)" UserInfo=0xa52d700 {com.facebook.sdk:HTTPStatusCode=403, com.facebook.sdk:ParsedJSONResponseKey={
    body =     {
        error =         {
            code = 200;
            message = "(#200) Feed story publishing to other users is disabled for this application";
            type = OAuthException;
        };
    };
    code = 403;
}

请告诉我在哪里误会?

2 个答案:

答案 0 :(得分:0)

2013/2/6删除了通过Graph API发布给用户用户的功能,请参阅此处的回答和参考:

Posting to friends' wall with Graph API via 'feed' connection failing since Feb 6th 2013

检查IOS Feed对话框示例:https://developers.facebook.com/docs/ios/ui-controls#feeddialog

答案 1 :(得分:0)

几个月前,Facebook实际上删除了通过Graph API在朋友的墙上发布的功能。 这一变化于2月6日生效。

您可以在此处阅读:https://developers.facebook.com/roadmap/completed-changes

  

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