这里有一个讨论:location (lat long) using facebook api但它并没有说明如何得到它...Facebook的API如何让经/纬从USER_LOCATION
我能得到基本的信息:
"location": {
"id": "104146386288393",
"name": "Newton, Massachusetts"
},
但如何让我使用的位置ID来获得
{
"id": "104146386288393",
"name": "Newton, Massachusetts",
"picture": "http://external.ak.fbcdn.net/safe_image.php?d=AQDygUYzFOcjhDoD&w=100&h=300&url=http\u00253A\u00252F\u00252Fupload.wikimedia.org\u00252Fwikipedia\u00252Fen\u00252Fe\u00252Fe6\u00252FNewton_City_Hall\u0025252C_Massachusetts.jpg&fallback=hub_city&prefix=s",
"link": "http://www.facebook.com/pages/Newton-Massachusetts/104146386288393",
"likes": 3741,
"category": "City",
"is_published": true,
"is_community_page": true,
"description": "<snipped data>",
"location": {
"latitude": 42.3369,
"longitude": -71.2097
},
"checkins": 310,
"talking_about_count": 8912
}
这里的请求是我的Facebook代码:
$user_profile = (new FacebookRequest($session, 'GET', '/me?fields=id, first_name, location'))->execute()->getGraphObject(GraphUser::className());
感谢
我无法弄清楚如何从我的数组让我的位置ID .. 。如果我使用'$ _SESSION [“fb_user_details”] [“location”] [“id”]'它不工作...任何想法如何从数组中获得我的位置ID? – user3011784
不知道你是如何努力实现这一目标的。为什么会议?为什么fb_user_details?只需要给/我一个api电话,它就会返回结果。 – luschn
只是一个更新,它不会在默认/我的结果中返回。你现在要做/我?fields = location。此外,位置现在也指位于location.id的带有ID的页面。然后该页面具有位置类型的位置字段,其具有坐标等。 – Bon