【发布时间】:2012-02-04 16:12:16
【问题描述】:
我正在使用 javascript SDK 来触发 fb.ui 的发送方法。如果我以自己的身份登录并将消息发送给我团队中的其他开发人员,它就会起作用。当我以测试用户身份登录并发送给另一个测试用户时,没有错误,但接收者永远不会收到消息。
下面的代码显示了我的按钮的点击事件:
$(".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; ?>'
});
});
【问题讨论】:
-
你能在 Graph API Exporer 中复制这个问题吗?如果是这样,那么这是一个错误。如果您不能,并且您的代码很好,并且其他开发人员可以重现该问题,那么这是一个错误。否则,您的代码需要一些工作。我不是 PHP 人,但你的代码看起来不错。
-
几天后我正准备这样做,但发现消息可能在延迟几个小时或更长时间后才通过。我想知道是否会出现一些延迟。
-
一个小时的延迟太多了。应该是几秒钟的事情。