你会怎样做:
strUserID = FB.getSession()。uid;
使用新的JS SDK?
登录后获取用户ID的简单调用?
答案 0 :(得分:0)
参考:http://developers.facebook.com/docs/reference/javascript/FB.getLoginStatus/
FB.getLoginStatus(function(response) {
if (response.authResponse) {
// logged in and connected user, someone you know
} else {
// no user session available, someone you dont know
}
});
响应:
{
status: 'connected',
authResponse: {
accessToken: '...',
expiresIn:'...',
signedRequest:'...',
userID:'...'
}
}