Solving Problems Subscribing to Facebook Real-time Updates

Facebook’s Real-time Updates documentation is not very explicit on how to subscribe to a feed, especially when all I am looking for is an example. So after figuring out what OAuthException (#15) "This method must be called with an app access_token" was trying to tell me and fixing the problem, I figured I would share my PHP example here. Hopefully, it will be helpful to you.* There are two parts that you need to set up:

  1. Setup an endpoint for the subscription
  2. Post to Facebook and tell them you are subscribing
  1. Get an access_token
  2. POST to Facebook with cURL

Continue reading