0

我想在使用 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'});
        }

我该怎么做?

4

1 回答 1

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

允许

于 2012-05-06T10:53:18.763 回答