Facebook Graph API 仅 returns 用户名
Facebook Graph API only returns user name
我正在使用 Facebook 的图表 api,要求输入“/me”,但它只有 returns 用户的姓名和 ID。我知道它正确登录,因为它 returns 正确的名称。
这是我使用的 javascript 代码片段:
FB.login(function (response) {
// handle the response
FB.api('/me', function (usrresponse) {
document.getElementById('inFbStatus').innerHTML = 'Successful login to Facebook';
console.log(JSON.stringify(usrresponse));
});
}, { scope: 'email, basic_info' });
您必须指定要返回的每个字段和边,例如。 G。
/me?fields=id,name,email
我正在使用 Facebook 的图表 api,要求输入“/me”,但它只有 returns 用户的姓名和 ID。我知道它正确登录,因为它 returns 正确的名称。
这是我使用的 javascript 代码片段:
FB.login(function (response) {
// handle the response
FB.api('/me', function (usrresponse) {
document.getElementById('inFbStatus').innerHTML = 'Successful login to Facebook';
console.log(JSON.stringify(usrresponse));
});
}, { scope: 'email, basic_info' });
您必须指定要返回的每个字段和边,例如。 G。
/me?fields=id,name,email