麻烦与Facebook fql阅读页面粉丝

时间:2013-05-10 10:15:37

标签: facebook facebook-javascript-sdk

我在Facebook应用程序选项卡中遇到了facebook jql和javascript sdk的问题。如果用户已登录,则我想读取用户是否是该页面的粉丝。如果是这样,请重定向到特定的粉丝页面,否则重定向到另一个页面。但由于某些原因,fql结果集为空(但我是该页面的管理员,当然还有它的粉丝;-))

这是一段代码:

if (response.status === 'connected') {
// The response object is returned with a status field that lets the app know the current
// login status of the person. In this case, we're handling the situation where they 
// have logged in to the app.
FB.api({
method:     'fql.query', 
query:  'SELECT uid FROM page_fan WHERE uid=me() AND page_id=188705819498'
}, function(resp) {
if (resp.length) {          

self.location.href = 'fanpage.html';
} else {
self.location.href = 'infopage.html';
}
}
);    

1 个答案:

答案 0 :(得分:2)

您需要user_likes权限才能阅读他/她的喜欢。如果它没有帮助尝试PHP SDK,请尝试。当javascript和PHP返回不同的结果时,我遇到了这样的问题。