I am building an iOS app using Appcelerator and the build in Facebook API module. I need to find a way to publish checkin on the behalf of the user. The user must be able to checkin at at location and / or a specific FB page. Is this possible? I can publish status messages but I cannot add a location (place).
Share
It is possible – you need to use Facebook’s Graph API, which is accessible the Titanium.Facebook.requestWithGraphPath method. This blog post describes how this is done on iOS, but the workflow is the same – although the author says that Facebook’s API has changed recently, so YMMV – I couldn’t find any explicit documentation in Facebook’s developer resources.
Here’s how you’d request the appropriate permission from the user:
Here’s an example URL that you’d use (using Titanium.Network.createHTTPClient to make a GET request) to find a list of places
https://graph.facebook.com/search?q=coffee&type=place¢er=37.76,122.427&distance=1000
Then list those places in a table view, and when the user taps one, you POST to create a checkin, assuming you have the ID of the place, and its coordinates, in appropriately named variables:
You may need to tweak the properties that you send to Facebook if the API has changed, but the general approach is correct.