2011-02-28 90 views
3

我正在開發Facebook canvas iFrame應用程序,而且我瘋了。 我正在嘗試檢查用戶是應用所在頁面的粉絲,以便我可以允許或禁止投票。pages.isFan返回不正確的簽名

我使用下面的代碼:

function CheckFan() { 
FB.init({ 
    appId: 'xxxxxxxxxxxxxxxxxxxxxxxxxx', 
    status: true, // check login status 
    cookie: true, // enable cookies to allow the server to access the session 
    xfbml: true // parse XFBML 
}); 


FB.api({ method: 'pages.isFan', page_id: '145116742177104' } 
    , function(resp) { 
     if (resp) { $('#main_frame').show(); $('#non_fan').hide(); } 
     else { $('#main_frame').hide(); $('#non_fan').show(); } 
    }); 
} 

這個js SDK是推動我逼瘋了,而調用文件「不完全」是侮辱不完整。

任何輸入將被appriciated。

謝謝! -Elad

回答

2

這已被Facebook棄用。 當我們需要部署應用程序時,一個新的Graph API替代品將可以使用。

現在我用FQL:

FB.api({ method: 'fql.query', query: 'SELECT uid FROM page_fan WHERE uid= ' + user_id + ' AND page_id=145116742177104' }, 
    function(result) { 
     if (result.length) 
     { $('.main_frame').show(); $('#non_fan').hide(); } else { $('.main_frame').hide(); $('#non_fan').show(); } 
    });