如何检查用户是否已授予publish_actions权限

时间:2011-12-04 00:05:35

标签: facebook facebook-opengraph

我设法请求了publish_actions权限,但由于它可以从“帐户设置”页面上的“应用程序”选项卡中撤消,因此我还必须能够检查是否仍然授予了权限。我尝试了以下方法:

// Check for publish_actions extended permission
var query = FB.Data.query('select publish_actions from permissions where uid={0}', fbuid);
query.wait(function(rows) {
    if(rows[0].publish_actions == 1) {
        console.log('The user has granted the extended permission');
    } else {
        console.log('The user has not granted the extended permission');
    }
});

此方法确实适用于publish_stream权限,但不适用于publish_actions权限。如果有人可以提供帮助,我会非常高兴,我非常沮丧。

更新 类型错误。它有效,对不起:]

1 个答案:

答案 0 :(得分:1)

我已经更新了自己的问题,所以答案就是问题中的代码。