我正在做的一个项目中,我已经实现了使用图形API的朋友邀请,我张贴在朋友的墙上邀请他们到我的网站,这是一个朋友邀请工作很好的一次,我想邀请多个朋友在同一时间,我怎么才能给邀请多个朋友的ID?下面是我在墙上发布的代码
FB.ui(
{
method: 'feed',
name: 'My Books',
picture: 'abc.jpg,
caption: 'Reference Documentation',
to: friend_id,
description: 'Join.'
},
function(response) {
if (response && response.post_id) {
DivMsgText("Friend has been invited");
}
}
);如何在收件人字段中指定多个好友的ID?我有显示好友的数组,但当我在to字段中指定它时,它不会张贴在墙上
发布于 2012-03-30 23:48:59
您不能在该字段中指定多个ID。当你认为垃圾邮件是多么容易的时候,它是有意义的。如果你想在多个用户的朋友上发帖,可以试试graph api:
$user_ids = new Array(); //array of user ids;
for($i = 0; $i<$total_ids; $i++)
{
$result = $facebook->api('/'.$user_ids[$i].'/feed', 'post', array(
'message' => $status,
'picture' => $picture,
'link' => $link,
'name' => $name,
'caption' => $caption,
'description' => $desc,
));
}但问题是,你不能把它贴到太多人的长城上。它很可能会超过php的最大执行时间60秒。
https://stackoverflow.com/questions/9941995
复制相似问题