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