Facebook API Android

I tried to create a feed application that will show feeds from facebook and other social platforms, but the problem I encountered is a real-time update on my server when a user posts something to his wall on facebook. Is there a way to get real-time data without any requests to facebook servers to find out if the user posted anything, i.e. facebook servers will notify me that the user has added a message so that I can receive this entry and save its server and notify others that the user has added the message to facebook.

PS- I read about Webhooks from the Api chart, but was not sure if they would work or not.

+4
source share
1 answer

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

New in 2.5+ : your callback url should also be on HTTPS.

According to the document, if you are subscribed to a change in the field feed, you will be notified, after which you will need to make a request to receive all messages.

They even have a sample for parsing and a hero: https://github.com/fbsamples/graph-api-webhooks-samples

NOTE. Your application must be included in the whitelist of Facebook. In addition, the user can disable this behavior in the settings of his application.

+1

Source: https://habr.com/ru/post/1621817/


All Articles