Facebook Graph API only returns user name

大憨熊 提交于 2019-12-23 11:53:10

问题


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.

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' });

回答1:


You have to specify each field and edge you want to get returned, e. g.

/me?fields=id,name,email


来源:https://stackoverflow.com/questions/31600821/facebook-graph-api-only-returns-user-name

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!