2012-10-17 66 views
0

可能重复:
Facebook API SDK revoke access如何允许用户使用JS SDK取消授权我的画布应用程序?

任何人都可以提供一段代码,取消授权(或撤销访问令牌),我与JS SDK画布应用程序?

我试过很多东西,通过以下链接this related question,但文档是混淆,我不断收到错误消息。

我当前的代码:

$('#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 
    }); 
}); 

相关链接

回答

0

嗯,我整理出来。当然,我太复杂了。 The other question其实确实有答案,我刚开始应用得不正确。我还会将我的代码片段添加到该问题中。

工作代码:

$('#deAuth_button').click(function(){ 
    FB.api('/me/permissions', 'delete', function(response) { 
     console.log(response); // true 
    }); 
}); 
相关问题