1

I have setup realtime facebook update for both user and page. Whenever user updates his status, I get request on my server about the change. The data I get from facebook post call is like below.

{  
   "object":"user",
   "entry":[  
      {  
         "uid":"10152689315982483",
         "id":"10152689315982483",
         "time":1427362347,
         "changed_fields":[  
            "feed"
         ]
      }
   ]
}

But I did not get any call from facebook when admin of a page update its status.

I followed the below steps to get the realtime facebook update.

  • Subscribe user/page to get updates with access token.

    graph.facebook.com//subscriptions?object=user&fields=feed&verify_token=&method=post&callback_url=htps://serverurl/realtime.php

  • To get the list of subscription

    graph.facebook.com//subscriptions

From this call I get both user and page data.

{
  "data": [
    {
      "object": "user", 
      "callback_url": "https://serverurl/realtime.php", 
      "fields": [
        "feed"
      ], 
      "active": true
    }, 
    {
      "object": "page", 
      "callback_url": "https://serverurl/realtime.php", 
      "fields": [
        "feed"
      ], 
      "active": true
    }
  ]
}

I also added the app to page-tab but still not getting the updates for page. Could anyone tell me what I am missing?

Hassan Siddique
  • 1,590
  • 14
  • 27
  • _“I also added the app to page-tab”_ – this is not how that works any more. https://developers.facebook.com/docs/apps/changelog#v2_2_new_features, https://developers.facebook.com/docs/graph-api/reference/v2.2/page/subscribed_apps (the latter link might not show the expected content right now, FB docs seem to have some issues at the moment.) – CBroe Mar 26 '15 at 16:15
  • FB docs not describe well about their APIs and it keep changing their APIs very fastly... – Hassan Siddique Mar 27 '15 at 09:13
  • 1
    @HassanSiddique this API is still working? Cause I don't receive any notification for user status changes – shaithana May 05 '16 at 20:09

1 Answers1

7

Do an http GET on

https://graph.facebook.com/v2.3/{page-id}/subscribed_apps?access_token=PAGE_ACCESS_TOKEN

If your app is not listed, you need to "install it" (this is an alternative installing the app as a page tab app). Do this by issuing a post request to the same url. Eg with curl,

curl -X POST "https://graph.facebook.com/v2.3/{page-id}/subscribed_apps?access_token=PAGE_ACCESS_TOKEN"

You don't need to supply any parameters since the id of the app you wish to install is inferred from the access token.

If /subscribed_apps already includes your app id, you may be experiencing a bug and should report it at http://developers.facebook.com/bug

ifaour
  • 38,035
  • 12
  • 72
  • 79
Dave Dosanjh
  • 116
  • 2