如何使用facebook图的url路径获取用户位置?

时间:2015-03-09 03:48:21

标签: php facebook facebook-graph-api laravel-5 facebook-graph-api-v2.2

现在我可以获取用户的姓名,头像,用户的电子邮件,但是当我尝试将此用于位置https://graph.facebook.com/v2.2/1234567890/location时,我会收到此消息

{
   "error": {
      "message": "Unknown path components: /location",
      "type": "OAuthException",
      "code": 2500
   }
}

1 个答案:

答案 0 :(得分:0)

用户位置的

资源网址为{id}/locations

https://graph.facebook.com/v2.2/1234567890/locations

遗憾的是,位置资源已在v2.0或更高版本中弃用。访问上述网址将返回

{
"error": {
  "message": "(#12) user locations API is deprecated for versions v2.0 and higher",
  "type": "OAuthException",
  "code": 12
         }
}