I’m using the javascript SDK to fire the send method of fb.ui. It works if I’m logged in as myself and send the messages to other developers on my team. When I log on as a test user and send to another test user, there is no error but the receiver never gets the message.
Code below shows click event from my button:
$(".invite_fb_friends").click(function() {
<?php
$subject = __("Please check out Volved", "volved", "volved");
if (isset($current_user->volved_cause)) {
$p = get_post($current_user->volved_cause);
$invite_id = get_user_personal_invite();
$description = sprintf(__("Follow this link and join me in supporting %s, or a cause of your choice!"),
$p->post_title);
$link = site_url("/cause/". $p->post_name . "/?invite_id=" . $invite_id);
$picture = get_bloginfo('template_directory'). '/images/cause_images/' . $p->post_name . '/logo.jpg';
} else {
//No cause chosen
$description = __("If you follow this link, you'll learn about Volved. If you like, sign up and start making a difference.");
$link = site_url("/");
$picture = get_bloginfo('template_directory') . '/images/logo64.png';
}
//call below documented at: https://developers.facebook.com/docs/reference/dialogs/send/
?>
res = FB.ui({
method: 'send',
name: '<?php echo $subject; ?>',
link: '<?php echo $link; ?>',
//picture: '<?php echo $picture; ?>', //Does not seem to work with valid URL. HTML shows URL but no pic displayed. Leaving blank shows picture of sender
//redirect_uri: filling this in creates an error on facebook
description: '<?php echo $description; ?>'
});
});
Test users can only send messages to other test users. If your other user is a real user, your own account for example, it will not send.
From Facebook:
https://developers.facebook.com/docs/test_users/