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.
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.
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);
}
Does anyone here know:
- Why this is happening
- Whether there is any way to get around it to post to all the users
- If so, what this would be?
Thank you.
Well, I don't think that Facebook considers a message sent to more than 15 members as a spam message and blocks it.
There are certain applications which on single click promote themselves through a user's chat, wall post on every friend and each group joined by the user!
Facebook blocks "spam" messaging. You cannot do bulk messages greater than 15 or 20 friends.