Facebook的API('/我“)不返回用户名 [英] Facebook api('/me') not returning username

查看:247
本文介绍了Facebook的API('/我“)不返回用户名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想实现与Facebook登录 - 迄今所有从我返回不包括用户名(我知道确实存在)在$用户数据的工作,除了

I am trying to implement a login with Facebook - thus far all is working, apart from the $user data I am being returned does not include the username (which I know does exist).

我返回我的数组是以下(含清除详细信息):

The array I am being returned is the following (with details purged):

Array ( [id] => ################ [email] => #.########@#####.co.uk [first_name] => ######## [gender] => male [last_name] => ######## [link] => https://www.facebook.com/app_scoped_user_id/################/ [locale] => en_GB [name] => ######## ######## [timezone] => 1 [updated_time] => 2014-05-06T21:23:33+0000 [verified] => 1 )

有没有人有这种体验过吗?

Has anyone had experience of this before?

推荐答案

用户名字段在图形API 2.0版本中删除。我不知道有任何变通办法的(短期使用1.0版本)。

The username field was removed in version 2.0 of the graph API. I'm not aware of any workaround (short of using version 1.0).

这变化中所列的升级指南的删除端点部分。您还可以看到用户参考没有提到的用户名 2.0版本,但是的 https://developers.facebook.com/docs/graph-api/reference/v1.0 /用户相对=nofollow>确实为1.0

This change is listed in the "Removed Endpoints" section of the upgrade guide. You can also see that the "User" reference contains no mention of a username field for version 2.0, but does for version 1.0.

不是所有的领域都可以通过API。你可以清楚地看到哪些领域的的使用提供我上面提供的参考。

Not all fields are available through the API. You can see exactly what fields are available using the references I've provided above.

这篇关于Facebook的API('/我“)不返回用户名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆