且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在 Facebook Graph API v2.1 中通过用户名获取用户 ID

更新时间:2021-12-17 07:25:25

这是出于隐私原因故意的.如果您能够获得具有唯一用户名的(真实)用户 ID,则根本不需要发明 App Scoped ID.

This is intentional for privacy reasons. If you would be able to get the (real) User ID with the unique username, there would be no need to invent App Scoped ID at all.

如果调用/me/username,会返回如下错误:

If you make a call to /me/username, it will return the following error:

(#803) 无法通过用户名查询用户

(#803) Cannot query users by their username

顺便说一句,从 v2.0 开始,您甚至无法获取用户名,只能获取真实姓名.

Btw, you cannot even get the username since v2.0, only the real name.