php – Facebook只返回用户的姓名和身份

前端之家收集整理的这篇文章主要介绍了php – Facebook只返回用户的姓名和身份前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在尝试使用我的Facebook帐户登录到我的网站,但是Facebook仅提供不足以登录用户名称和ID.在获取完整的信息,如姓,姓,电子邮件等之前

数据由facebook现在提供:

stdClass Object
(
    [name] => FName LName
    [id] => 236189327864097
)

我使用Oauth v2.0通过Facebook登录到我的网站.

看来您正在使用Graph API的v2.4.看到

> https://developers.facebook.com/docs/apps/changelog#v2_4

Declarative Fields
To try to improve performance on mobile networks,Nodes and Edges in v2.4 requires that you explicitly request the field(s) you need for your GET requests. For example,GET /v2.4/me/Feed no longer includes likes and comments by default,but GET /v2.4/me/Feed?fields=comments,likes will return the data. For more details see the docs on how to request specific fields.

要想知道如何使用所谓的字段扩展,请看看

> https://developers.facebook.com/docs/graph-api/using-graph-api/v2.4#fields

原文链接:https://www.f2er.com/php/131922.html

猜你在找的PHP相关文章