幸运的是,在尝试从 Facebook 帐户获取好友列表时,我得到了一些无法理解的响应,这就是我在 console.log 时得到的结果:
#v_3 { __wrapped=#v_3, __observableEvents={...}, name="v_3", more...}
The method FB.Data.query:toString is not officially supported by Facebook and access to it will soon be removed.
这是我的登录代码并获取用户的好友列表成员:
FB.init({ appId:'my_appid' });
// fetch the status on load
FB.getLoginStatus(handleSessionResponse);
$('#login').bind('click', function() {
FB.login(handleSessionResponse);
});
$('#logout').bind('click', function() {
FB.logout(handleSessionResponse);
});
// handle a session response from any of the auth related calls
function handleSessionResponse() {
FB.api('/me', function(response) {
var access_token = FB.getAuthResponse()['accessToken'];
console.log(access_token);
console.log(response);
var friends = FB.Data.query('SELECT uid, flid FROM friendlist_member WHERE flid IN (SELECT flid FROM friendlist WHERE owner=me())');
console.log(friends);
$('#user-info').html(response.id + ' - ' + response.name);
});
}
有人遇到过同样的问题吗?