0

Possible Duplicate:
Facebook API SDK revoke access

Can anyone provide a code snippet to de-authorize (or revoke the access token for) my canvas app with the JS SDK?

I've tried numerous things by following the links in this related question, but the Documentation is confusing, and I keep recieving error messages.

My current code:

$('#deAuth_button').click( function(){
    var user_id = ____user_id____,
        ap_id = ____app_id____,
        req_id = ap_id + '_' + user_id;

     FB.api(req_id, 'delete', function(response) {
        console.log(response); 
       // error (#200) The user hasn't authorized the application to perform this action
    });
});

Relevant Links:

Community
  • 1
  • 1
Zach Lysobey
  • 14,959
  • 20
  • 95
  • 149

1 Answers1

0

Well, I sorted it out. I was getting too complicated of course. The other question actually did have the answer, I was just applying it incorrectly at first. I will also add my code snippet to that question.

Working code:

$('#deAuth_button').click( function(){
     FB.api('/me/permissions', 'delete', function(response) {
        console.log(response); // true
    });
});
Community
  • 1
  • 1
Zach Lysobey
  • 14,959
  • 20
  • 95
  • 149