Search code examples
facebook-graph-apiwebsocketsocket.iofacebook-timeline

Facebook graph API with websocket?


I have an app that needs to seek and receive information from User timeline, The facebook API provides support websockets? What are my alternatives to get information if it does not offer?


Solution

  • The Graph API doesn't support WebSockets. But, if you have a NodeJS server at hand, you could for example use the Realtime Updates API (https://developers.facebook.com/docs/graph-api/real-time-updates/v2.0).

    You'd then have to create an endpoint which is reachable for Facebook to push the updates to. this endpoint then needs to query the Graph API for the actual update. Of course, this only works if the respective user gave his permissions to your Facebook app.

    The output could then be used to update the WebSocket.