How to get place_id before checkin?

最后都变了- 提交于 2019-12-03 16:26:59
Zany

Each checkinable place must have a valid Place Facebook Page.

The place parameter takes in the page_id of a Place Facebook Page.

For example, page_id 104999729569954 of Place Facebook Page http://www.facebook.com/pages/Nanyang-Polytechnic/104999729569954


If your application is letting your users to checkin based on their current location

1) Use an external map service such as Google Map's Geolocation to get the coordinates(lat & lon) of your user's current location.

The set of coordinates returned from Google Map is different from Facebook's own set of coordinates.

2) To overcome this, do a FQL query to find the closest match of Facebook's coordinates with Google Map's coordinates.

SELECT page_id,latitude,longitude FROM place WHERE distance(latitude, longitude, "LAT_HERE", "LON_HERE") < 250

250 refers to the radius(m) that it will search within, it can go up to 50000.

3) Now that you have page_id, latitude and longitude. Assign page_id into place parameter. Assign latitude and longitude into coordinates parameter. You will then be able to publish checkin.

You can refer to publish checkin examples that I have posted over here. Facebook - Publish Checkins using PHP SDK/JavaScript SDK


If your application is letting your users to checkin based on selection from a list of place names or gallery of images (in a game or something)

You will just need to find the page_id of each place and bind them to respective place name or image.


Documentation

Page FQL - http://developers.facebook.com/docs/reference/fql/page/

Checkins API - http://developers.facebook.com/docs/reference/api/user/#checkins

Maybe this is what you want. Open graph explorer Just replace URL with any facebook page url

fql?q=SELECT id FROM object_url WHERE url="https://www.facebook.com/LegendCinema"

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!