dt246813579 2013-05-21 21:00 采纳率: 0%
浏览 30
已采纳

检测Facebook App Canvas已卸载

I need to detect that a user unloads my Facebook app (navigates to somewhere else or logs out of Facebook). How can this be done? I have tried:

FB.Event.subscribe('auth.logout', function(response) {
    console.log('logged out');    
});

But this never fires :(

  • 写回答

1条回答 默认 最新

  • doumi1852 2013-05-21 21:15
    关注

    why not try to listen to the window unload event rather than using the Facebook API:

    window.addEventListener('unload', function(event) {
       console.log('Bye bye!');
    });
    

    This should catch the situations you need

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?