fb.ui 发送方法不适用于 facebook 中的测试用户

发布于 2024-12-25 21:34:36 字数 1687 浏览 4 评论 0原文

我正在使用 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; ?>'
    });

});

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; ?>'
    });

});

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

椒妓 2025-01-01 21:34:36

测试用户只能向其他测试用户发送消息。如果您的其他用户是真实用户,例如您自己的帐户,则不会发送。
来自脸书:
https://developers.facebook.com/docs/test_users/

限制

我们确保测试用户免受 Facebook 垃圾邮件或虚假邮件的影响
帐户检测系统,确保您可以测试您的应用程序而无需
担心自己会残疾。

此外,确保使用测试用户帐户来测试各种
场景不会最终无意中创建垃圾邮件,我们强制执行
对测试用户可以执行的操作有一定的限制。

测试用户只能与其他测试用户交互,不能与真实用户交互
现场用户。测试用户无法粉丝公共主页或创建公共主页
上面的内容就像在页面的墙上写字一样。然而,测试用户可以
查看页面上的应用程序选项卡并与之交互(如果它们关联)
与该应用程序。任何开发人员都可以访问和使用它们
关联的应用程序。他们仅拥有关联应用程序的测试权限。
这意味着他们可以在实时模式或沙盒模式下使用该应用程序
但无法编辑任何技术设置或访问相关见解
应用程序。测试用户始终是测试用户,不能转换为测试用户
普通用户帐户。

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/

Limitations

We ensure that test users are exempt from Facebook spam or fake
account detection systems to ensure that you can test your app without
worrying about getting disabled.

Also, to ensure that using test user accounts to test various
scenarios doesn't end up unintentionally creating spam, we enforce
certain limitations on what test users can do.

Test users can interact with other test users only and not with real
users on site. Test users cannot fan a public Page or create public
content on them like writing on a Page's wall. A Test user can however
view and interact with the app tab on the Page if they are associated
with that app. They can be accessed and used by any developer of the
associated app. They only have test privileges on the associated app.
This implies that they can use the app in live mode or sandbox mode
but cannot edit any technical settings or access insights for that
app. A test user is always a test user and cannot be converted to a
normal user account.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文