我在 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';
}
}
);