我希望在使用Javascript登录后获取用户的FID,电子邮件和姓名,因此我进行了Ajax调用并将其保存到数据库中。
这是目前登录用户的代码:
if (response.status === 'connected') { // the user is logged in and connected to your application
var uid = response.authResponse.userID;
var accessToken = response.authResponse.accessToken;
// Alert with fid, email and name
} else { //the user isn't logged in to Facebook or isn't connected to the application
FB.login(function(response) {
if (response.authResponse) {
accessToken = response.authResponse.accessToken;
// Alert with fid, email and name
}
}, {scope: 'email'});
}
我该怎么做?
答案 0 :(得分:2)
呼叫
https://graph.facebook.com/me
或
https://graph.facebook.com/USER_ID
或
https://graph.facebook.com/fql?q=SELECT uid,name,email FROM user WHERE uid=me()
你需要
email
许可