Facebook Graph API只返回用户名 [英] Facebook Graph API only returns user name
本文介绍了Facebook Graph API只返回用户名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用Facebook的图形API,要求'/ me',它只返回用户的名称和ID。我知道它正确登录,因为它返回正确的名称。
I was using Facebook's graph api, asking for '/me', and it only returns the name and Id of the user. I know that it logs in properly, because it returns the correct name.
以下是我使用的JavaScript代码片段:
Here is a snippet of the javascript code I was using:
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' });
推荐答案
你必须指定你想要的每个字段和边得到回报,e。 G。
You have to specify each field and edge you want to get returned, e. g.
/me?fields=id,name,email
这篇关于Facebook Graph API只返回用户名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文