-1
我已經開發與應用一個Facebook頁面,
我想是,只要任何用戶訪問我的頁面上,用戶通過一個服務彈出消息時,只有當用戶點擊「like」按鈕時,彈出窗口才會消失,如果用戶已經喜歡該頁面,彈出窗口不會出現,爲此,我寫下面的代碼
FB.getLoginStatus(function(response) {
if (response.status === 'connected') {
var user_id = response.authResponse.userID;
var page_id = "app_id";
var fql_query = "SELECT uid FROM page_fan WHERE page_id = "+page_id+"and uid="+user_id;
var the_query = FB.Data.query(fql_query);
the_query.wait(function(rows) {
if (rows.length == 1 && rows[0].uid == user_id) {
alert("liked the page");
popup.hide() // hide the popup as user has clicked like button
}
else {
alert("not liked ");
}
});
}
else if (response.status === 'not_authorized') {
}
else
{
alert("not logged in");
}
});
上面的代碼工作正常,只有一個FB用戶,其中之一是此頁的管理員,對所有其他用戶返回response.status === 'not_authorized'
狀態,所以我無法檢索用戶的登錄信息,因爲在這種情況下,我越來越null response.authResponse
有沒有人有任何想法,如何檢查所有用戶的登錄狀態,而不是管理員只... ??
謝謝。
感謝lix,它真的有竅門,再次感謝 – mack 2012-01-07 13:38:00