Facebook App:fb.api方法会在朋友的墙上张贴吗?

use*_*356 1 facebook facebook-graph-api

我已经尝试过FB.API方法在朋友墙上发帖.它不适合我.我冲浪了很多次.他们中的一些人告诉他们已被弃用.Facebook是否有关于此问题的官方信息?请帮我知道.谢谢.

供你参考,

function postOnMyFriendWall() {
            var body = 'Reading Connect JS documentation';
            FB.api('/friendid/feed', 'post', { message: body }, function(response) {
              if (!response || response.error) {
                alert('Error occured');
              } else {
                alert('Post ID: ' + response.id);
              }
            });
        }
Run Code Online (Sandbox Code Playgroud)

The*_*ard 7

截至2013年2月6日,您无法使用FB.API方法发布到朋友时间轴.
请阅读:https://developers.facebook.com/roadmap/completed-changes/

查找提要对话框打开图表操作作为替代方案.
Feed对话框示例:

function postToFriend() {

    // calling the API ...
    var obj = {
      method: 'feed',
      to: 'friend_id',
      link: 'http://www.facebook.com/thepcwizardblog',
      picture: 'http://fbrell.com/f8.jpg',
      name: 'Feed Dialog',
      caption: 'Tagging Friends',
      description: 'Using Dialogs for posting to friends timeline.'
    };

    function callback(response) {
      document.getElementById('msg').innerHTML = "Post ID: " + response['post_id'];
    }

    FB.ui(obj, callback);
  }
Run Code Online (Sandbox Code Playgroud)

Facebook对话的完整文档:https://developers.facebook.com/docs/reference/dialogs/feed/