Graph API shows Canvas items in Graph Explorer but not returned by PHP SDK
I'm retrieving posts from a page via the PHP SDK (version 5.0.0). The third post in the feed is a Canvas item and is being returned by the Graph Explorer: https://developers.facebook.com/tools/explorer/?method=GET&path=578588098993907%2Fposts%3Ffields%3Did%26limit%3D20&version=v2.8
Canvas items: https://www.facebook.com/business/news/introducing-canvas Note canvas items are only displayed on mobile and not on desktop - might be related.
When I retrieve the latest posts from the page via the PHP SDK the canvas post is completely ommitted :
$request = $this->client->request('GET',
'/578588098993907/posts',
array('limit' => 10, 'fields' => id));
$response = $this->client->getClient()->sendRequest($request);
$graphEdge = $response->getGraphEdge();
foreach ($graphEdge as $graphNode) {
echo $graphNode->getField('id');
}
(code simplified)
Gives:
578588098993907_578950888957628
578588098993907_578951082290942
578588098993907_578945485624835
578588098993907_578665362319514
578588098993907_578662648986452
578588098993907_578660458986671
578588098993907_578659585653425
578588098993907_578633098989407
578588098993907_578632585656125
578588098993907_578631848989532
The canvas post with ID 578588098993907_578950478957669 is completely omitted from the results.
链接地址: http://www.djcxy.com/p/32648.html上一篇: 脸谱图api:了解抵消