简体   繁体   中英

Detect Facebook App Canvas Unloaded

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 :(

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM