Reputation: 3
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 :(
Upvotes: 0
Views: 149
Reputation: 1734
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
Upvotes: 1