savvisingh
savvisingh

Reputation: 93

Facebook API Android

I was trying to create a feed app which will show the feeds from facebook and other social platforms but the problem I was facing was the real time update on my server when a user post something on his wall in facebook. Is there any way that I can get real time data without making any requests to facebook servers to see if the user has posted anything i.e. the facebook servers will notify me that the user has added a post so I can fetch that post and save to my server and notify others that the user has added a post on facebook.

P.S.- I have read about Webhooks from graph Api but was not sure whether they will work or not

Upvotes: 4

Views: 226

Answers (1)

verybadalloc
verybadalloc

Reputation: 5804

Yes, webhooks are the way to go: https://developers.facebook.com/docs/graph-api/webhooks/v2.5 Your callback URL will receive a POST, and will need to return a 200.

New in 2.5+: your callback URL will also need to be on HTTPS.

According to the doc, if you subscribe to a change in the field feed, you will be notified, at which point you would have to make a query to get all posts.

They even have sample setup for parse and heroku: https://github.com/fbsamples/graph-api-webhooks-samples

NOTE: your app will need to be whitelisted by Facebook. Also, a user can disable this behavior in their app settings.

Upvotes: 1

Related Questions