Need to post status update and attach user location by passing latitude and longitude. In FB docs they say, we need to pass “place” FB entity that is:
“an object containing id and name of Page associated with this location, and a location field containing geographic information such as latitude, longitude, country, and other fields (fields will vary based on geography and availability of information)”
How to create/get such place name from latitude and longitude? I’v read related post1 and post2 but was not able to find a working solution.
There is currently no API available for developers to create Facebook pages or places. However, you can get place name by doing a FQL query like this…
250refers to the radius(m) that it will search within, it can go up to50000.Doing this FQL query will return you the Facebook Place Page’s id, place name, latitude and longitude.
(Actually there is no need to get the place name as the
page_idis what you really need. Withpage_id, you will be able to get all the information of that Facebook Place Page.)Assuming you are actually trying to publish a checkin, you can refer to the references below to proceed further with the data you have obtained from the FQL query…
A normal status update(feed dialog) is different from a status update with location tagged to it(checkins), they are using different APIs.
References:
How to get place_id before checkin?
Facebook – Publish Checkins using PHP SDK/JavaScript SDK
Facebook Documentations
Page FQL – http://developers.facebook.com/docs/reference/fql/page/
Checkins API – http://developers.facebook.com/docs/reference/api/user/#checkins