duanba3707 2013-09-26 20:09
浏览 24

如何使用javascript / php发布在朋友的墙上

I need to post something on my friends wall. i used a facebook friend selector. I implemented like this

//Execute the friend selector

 $(document).ready(function() {
  $(".shareFriends").fSelector({
    facebookInvite: false,
    onSubmit: function(ids){            
        publish(ids) // call the below function
    },

});
});


function publish(ids){

FB.ui(
  {
   method: 'feed',
   name: 'Name',
   caption: 'caption',
   to:ids,
   description: 'description ',
   link: 'link to my app?uref=<?php echo $_SESSION['uid']; ?>',
   picture: 'path to image'
  },
  function(response) {
    if (response && response.post_id) {
      alert('Post was published.');

    } else {
     alert('Post was faild');
    }
  }
);

}

when i run this i'm getting this error.

API Error Code: 100
API Error Description: Invalid parameter
Error Message: [100006588491260] does not resolve to a valid user ID

//this user id is working

I entered recipient id direct. this method works properly.

FB.ui(
  {
   method: 'feed',
   name: 'Name',
   caption: 'caption',
   to:100006588491260,
   description: 'description ',
   link: 'link to my app?uref=<?php echo $_SESSION['uid']; ?>',
   picture: 'path to image'
  },

How to fix this issue. and how can i send same post on multiple friends wall?

  • 写回答

1条回答 默认 最新

  • douyasihefu6214 2013-09-26 20:19
    关注

    You can only specifiy one ID, not an array of IDs. There is one other possibility with the "send" dialog:

    https://developers.facebook.com/docs/reference/dialogs/send/

    ...but according to the docs, you can only open it for one user too, the difference is that the user is able to add more people directly in the popup:

    A user ID or username of a recipient. Once the dialog comes up, the sender can specify additional people, groups, and email addresses as recipients.

    评论

报告相同问题?

悬赏问题

  • ¥15 关于#网络安全#的问题:求ensp的网络安全,不要步骤要完成版文件
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥20 使用Photon PUN2解决游戏得分同步的问题
  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥30 BC260Y用MQTT向阿里云发布主题消息一直错误
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 Vue3 大型图片数据拖动排序