如何在Facebook的Graph API v2.0或更高版本中获取用户的用户名 [英] How to get user's username in v2.0 or later of Facebook's Graph API
问题描述
我过去很容易使用API 1.0获取用户的用户名,使用 / me
并获取用户名
响应对象的属性。
I used to get the user's username in the API 1.0 fairly easily, using /me
and getting the username
property of the response object.
现在我使用API 2.0收到此错误:
Now I'm getting this error with API 2.0:
( #12)版本v2.0及更高版本的用户名已被弃用
"(#12) username is deprecated for versions v2.0 and higher"
我到目前为止找到的唯一方法是使用FQL,但现在似乎已经不推荐了。
The only way I found to get this until now was to use FQL, but now it seems deprecated.
有人知道这个吗?谢谢!
Anyone knows a way around this? Thanks!
推荐答案
我并不意味着没有帮助,但是似乎对用户名的访问已经从API中删除,因为我可以告诉我应用程序可能使用用户名的位置(例如旧共享对话框)无法再与2.0 API一起使用。我认为它也是一种防止应用程序访问应用范围之外的可用唯一标识符的方法 - 您根据2.0 API检索的任何用户标识符都是您的应用程序所特有的。
I don't mean to be unhelpful, but it appears access to username has been removed from the API, as far as I can tell. Places where an app may have been using username, such as in the old share dialogs, can no longer do that when used with the 2.0 API. I think its also a way of preventing apps from having access to usable unique identifiers outside of the app scope - any user IDs you retrieve under 2.0 API are specific to your app alone.
这篇关于如何在Facebook的Graph API v2.0或更高版本中获取用户的用户名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!