我有一個用戶的電子郵件,並且我想使用javascript api在Facebook中搜索它們。使用JavaScript API執行Facebook搜索
我知道我需要的東西
FB.api('/search', {q: '[email protected]', type: 'user'}, function(response) {
//Handle response
});
但是,這似乎並沒有工作,我甚至不得到迴應。
我也試過把它放在裏面和/或打電話給FB.login()
,這只是由於某種原因失敗。
有什麼建議嗎?他們關於如何使用它的文檔非常模糊。
編輯:
這裏是所有的相應代碼:
<div id="fb-root"></div>
<script type="text/javascript" >
FB.init({
appId: 'apikey', //Actual API key removed for obvious reasons
status: true, // check login status
cookie: true, // enable cookies to allow the server to access the session
xfbml: true, // parse XFBML
oauth: true // enable OAuth 2.0
});
</script>
<script type="text/javascript" >
FB.login(function (response) {
if (response.authResponse) {
FB.api('/search', {q: '[email protected]', type: 'user'}, function(response) {
{
alert(response);
});
}
else {
alert(response.toString());
}
});
</script>
您是否得到了這個工作? – aleXela
@alexela從來沒有最終得到它的工作。 –