Facebook Streaming API does not return any data

149 Views Asked by At

I am facing trouble while accessing the real time facebook data using the Graph Streaming API. I have been successful in getting the data through Graph APIs for page. I have also been successful in extracting all the required tokens.

I have used -

  1. API to create a subscription

    graph.facebook.com/" + my_app_ID + "/subscriptions?callback_url=" + my_server_url" + object=page&fields=feed,name,general_info,description,mission&verify_token=streamInit&method=POST&access_token=" + my_app_token

which has been successful.

  1. API to add a page tab for the app

    graph.facebook.com/my_page_ID"+ "/tabs?app_id=my_app_ID&method=POST&access_token="+ my_page_token

which was also successful.

But still, I am not getting the POST data (real time changes on the page) on my_server_url.

I am not sure what is wrong. I have tried my best to go through all the blogs and the questions on this forum but still no luck!

1

There are 1 best solutions below

0
On

I finally found the solution to my problem, thanks to Facebook Developer Community. If you are using the APIs from version 2.4, we need to add the app as a subscribed app for the page instead of adding the app as the page tab. So, after the 1st API call (as shown in Question), the 2nd API call should be -

POST call to - https://graph.facebook.com/page_id/subscribed_apps

This successfully completes the app subscription to the page. I was able to get the realtime page updates on my callback url.