Facebook加载后apprequests的通知消失

时间:2013-02-22 00:23:22

标签: facebook-graph-api facebook-javascript-sdk apprequests facebook-app-requests

这是我用来加载SDK的代码:

window.fbAsyncInit = function() {
    FB.init({
        appId      : "<APP_ID>",
        status     : true,
        cookie     : true,
        xfbml      : true
    });
};

(function(d, s, id) {
    var js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) return;
    js = d.createElement(s); js.id = id;
    js.src = "//connect.facebook.net/en_US/all.js";
    fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));

当用户点击邀请按钮时调用此方法:

function inviteFriends(){
    FB.ui(
        {
            method: 'apprequests',
            message: 'invites you to play'
        },
        function(response){ console.log(response) } // temporary to verify
    )
}

用户体验如https://developers.facebook.com/docs/concepts/requests/#ux中所述,但当接收者登录时,Facebook加载后通知消失。

寻找答案,我发现了这些:

Notification for facebook app requests not showing up

http://facebook.stackoverflow.com/questions/11279765/facebook-pagetab-request-dialogue-notification-shows-and-goes

http://facebook.stackoverflow.com/questions/9689927/ios-fb-request-dialogs-not-working-properly

http://facebook.stackoverflow.com/questions/9812572/facebook-sdk-javascript-request-dialog-disappearing-on-receiver-side

http://facebook.stackoverflow.com/questions/8823362/invite-friends-for-a-website-app-fb-ui-apprequests

http://facebook.stackoverflow.com/questions/10209281/handle-facebook-apprequest-notification

http://facebook.stackoverflow.com/questions/8979826/facebook-notification-from-my-app-appears-and-disappears

可是:

  • 沙箱模式已停用;
  • 定义了画布应用网址,以及安全画布应用网址
  • 应用类型定义为Web。

我错过了什么?

2 个答案:

答案 0 :(得分:0)

Facebook正在测试如果用户对用户请求未显示在通知宝石上会发生什么。他们在这里解释一下:

https://developers.facebook.com/bugs/532388000129311

测试显然已经结束了,事情应该很快恢复正常,至少目前是这样。

答案 1 :(得分:0)

当您的画布应用未正确设置时,仍会发生这种情况。请参阅答案:

Facebook notification from my app appears and disappears