Facebook应用程序如何向所有用户的朋友发送消息?

问题描述:

我们正在尝试构建一个应用程序,可以在应用程序中具有适当祝福的登录用户的请求下发送消息给任何或所有用户的FB朋友,声明已发送礼物。

We're trying to construct an application that can - at the request of logged-in users with the appropriate blessings within the app - send out a message to any or all of the user's FB friends declaring that they have been sent a gift.

我们已经能够让这个工作只发送一些小朋友这个消息,作为一个墙上的帖子(通知和消息在API中不可用) 。但是,对于大于15的朋友,绝大多数用户返回一个 OAuthException:(#200)用户没有授权应用程序执行此操作

We have been able to get this to work for sending just a small few friends this message, as a wall post (notifications and messages are unavailable in the API). However, with any number of friends larger than ~15, the majority of the users return an OAuthException: (#200) The user hasn't authorized the application to perform this action.

这些相同的用户可以单独或小组发送消息。但是,我们期望拥有数百甚至数千个朋友的用户使用此功能。

These same users can be sent the message individually or in a small group. However, we expect to have this feature used by users with hundreds or even thousands of friends.

API文档尚未到来,尤其是因为它们位于旧的和新的图形界面。我们目前正在使用以下代码(以准确的方式)在PHP中使用当前Facebook会话与我们用户的凭据进行API请求:

The API docs have not been forthcoming, especially since they are stuck halfway between the old and new Graph interfaces. We are currently using the following code (in precis) to make the API requests, in PHP, in the presence of a current Facebook session with the credentials of our user:

$wall_info = $customer->getCustomWallData();

$attachment = array(
    'message' => $wall_info['msg'],
    'name' => $wall_info['link_title'],
    'caption' => $wall_info['link_caption'],
    'link' => $CUZ->index,
    'description' => '',
    'picture' => $CUZ->http . '/uploads/promo_logo/' . $wall_info['filename'],
    'actions' => array(
        array('name' => 'Get Search', 'link' => 'http://www.google.com')
    )
);

foreach($friendStack as $friend_data) {
    $friend_fb_id = $friend_data['fb_id'];
    $result = $facebook->api("/$friend_fb_id/feed/",'post',$attachment);
}

有人在这里知道:


  1. 为什么会发生这种情况

  2. 是否有任何方法绕过它发布到所有 li>
  3. 如果是这样,这是什么?

  1. Why this is happening
  2. Whether there is any way to get around it to post to all the users
  3. If so, what this would be?

谢谢。

Facebook阻止垃圾邮件消息传递。您不能做大于15或20个朋友的批量消息。

Facebook blocks "spam" messaging. You cannot do bulk messages greater than 15 or 20 friends.