如何在 v2.0 或更高版本的 Facebook Graph API 中获取用户的用户名 [英] How to get user's username in v2.0 or later of Facebook's Graph API
问题描述
我曾经很容易在 API 1.0 中获取用户的用户名,使用 /me
并获取响应对象的 username
属性.
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.
有没有办法解决这个问题?
Is there a way around this?
推荐答案
我并不是说没有帮助,但据我所知,对用户名的访问似乎已从 API 中删除.当与 2.0 API 一起使用时,应用程序可能一直在使用用户名的地方(例如在旧的共享对话框中)无法再使用用户名.我认为这也是一种防止应用访问应用范围之外可用唯一标识符的方法 - 您在 2.0 API 下检索的任何用户 ID 都特定于您的应用.
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.
这篇关于如何在 v2.0 或更高版本的 Facebook Graph API 中获取用户的用户名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!