An abridged version of my code:
$('#de-auth_button').click(function(){
FB.api('/me/permissions', 'delete', function (response) {
console.log(response); // true
FB.getLoginStatus(function (response) {
console.log(response.status); // connected
});
});
});
The comments represent the result of clicking this button while logged in and with permissions to the app (connected).
Clicking the button a 2nd time gives an error message (access token needed) for the first console.log and a response of not_authorized for the 2nd (which is what I’m trying to accomplish after one click)
The result of getting the login status is cached – if you want it “real time”, you’ll have to use the
forceparameter when calling theFB.getLoginStatusmethod, see https://developers.facebook.com/docs/reference/javascript/FB.getLoginStatus/