Get Facebook User ID from app-scoped User ID

前端 未结 5 2035
Happy的楠姐
Happy的楠姐 2020-11-28 05:34

With the upgrade from Facebook Graph API v1.0 to v2.0, Facebook is using \"App-scoped User IDs\", so I cannot see the \"original\" user ID inside my apps anymore.

I

5条回答
  •  遥遥无期
    2020-11-28 06:12

    there is a dirty hack to retrieve original user id

    http://graph.facebook.com/app-scoped-id this returns the facebook public information as follows, { "id": "app-scoped-id", "first_name": "xxxx", "gender": "male", "last_name": "yyyy", "link": "https://www.facebook.com/zzzz", "locale": "en_US", "name": "xxxx yyyy", "username": "zzzz" }

    Then you make another graph api call with username http://graph.facebook.com/zzzz

    This will returns the original facebook id and other public information, instead of app-scoped-id

提交回复
热议问题