How to get user's username in v2.0 or later of Facebook's Graph API

后端 未结 3 556
醉梦人生
醉梦人生 2020-12-25 11:51

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.

Now I\'

3条回答
  •  梦毁少年i
    2020-12-25 12:30

    As a workaround you can use the email as a unique identifier. Email address can be retrieved using "email" as the permission scope.

    Facebook has removed the username field from the new API version. It is not possible to retrieve the username. But Facebook provides an application specific unique ID. If you need to share the same user between several apps you can use the newly introduced Business Mapping API. This allows to add all the required apps to a group. In this case the ID will be unique among all the apps in the group.

    More information on Business Mapping API is available at https://developers.facebook.com/docs/apps/for-business 1

提交回复
热议问题