I've just upgraded to graph api 2.5 and the PHP SDK 5.0 and it seems the way in which you get a pages notifications has changed.
In the past I could call:
/{page_id}/notifications
and get a response like this:
{
"id": "notif_12345_12345",
"from": {
"name": "John Doe",
"id": "12345"
},
"to": {
"name": "Page Name",
"category": "Community",
"id": "12345"
},
"created_time": "2015-11-01T16:23:38+0000",
"updated_time": "2015-11-01T18:10:26+0000",
"title": "John Doe and Jane Doe commented on a link you shared.",
"link": "http://www.facebook.com/page/posts/12345?comment_id=12345"
}
Perfect, exactly what I wanted. But in 2.5 I just get:
{
"data": [
{
"to": {
"name": "Page Name",
"id": "12345"
},
"id": "notif_12345_12345"
},
{
"to": {
"name": "Page Name",
"id": "12345"
},
"id": "notif_12345_67890"
}
}
And I have no idea what to do with this? I've tried making a request for:
/notif_12345_67890
But it just returns the same info.
Is there anyway to get the notification details in the graph api these days?
For completeness sake here's what i'm doing with PHP, although the response can also be tested in the graph explorer.
$sdk = new \Facebook\Facebook([
'app_id' => $app_id,
'app_secret' => $app_secret,
'default_graph_version' => 'v2.5',
]);
$response = $sdk->get($page_id.'/notifications', $access_token);
$graphEdge = $response->getGraphEdge();
// Iterate over all the GraphNode's returned from the edge
foreach ($graphEdge as $graphNode) {
var_dump($graphNode);
}