Reputation: 2555
I'm very new to facebook development. I'm trying to link a user to liking my facebook page and then detecting the successful like. I've seen a lot of web code for this, but what would be the best approach to do this from a mobile app? Hopefully something I can easily port between all mobile app platforms.
Thanks
Upvotes: 0
Views: 244
Reputation: 269
Only the Javascript SDK lets you subscribe to a Like event directly in the app.
There's two methods you could use:
Use the Realtime Updates API to subscribe to the user.likes object, which will fire a callback at your server when the 'likes' changes.
You can then check this periodically in your app.
The obvious con is that you need to have a server backend component to your app.
Continually request the user.likes object through the Graph API in your app.
This isn't particularly great either because you have to keep making requests to Facebooks servers, which usually take up to 2 seconds to reply.
You might easily end up hitting the daily request limit if you have a lot of users all continually making requests.
--
Now - you say you're writing mobile apps for all platforms; if by chance you're doing this as mobile web (i.e. Phonegap or similar) then you're in luck, you can do this through a Phonegap plugin.
Upvotes: 1