Graph API在Graph Explorer中显示Canvas项目,但未由PHP SDK返回
我通过PHP SDK(版本5.0.0)从页面检索帖子。 Feed中的第三篇文章是一个Canvas项目,并由Graph Explorer返回:https://developers.facebook.com/tools/explorer/?method=GET&path=578588098993907%2Fposts%3Ffields%3Did%26limit%3D20&version= V2.8
画布项目:https://www.facebook.com/business/news/introducing-canvas注意画布项目仅显示在移动设备上,而不是桌面上 - 可能是相关的。
当我通过PHP SDK从页面检索最新帖子时,画布帖子完全省略:
$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');
}
(代码简化)
得到:
578588098993907_578950888957628
578588098993907_578951082290942
578588098993907_578945485624835
578588098993907_578665362319514
578588098993907_578662648986452
578588098993907_578660458986671
578588098993907_578659585653425
578588098993907_578633098989407
578588098993907_578632585656125
578588098993907_578631848989532
结果中完全省略ID为578588098993907_578950478957669的画布帖子。
链接地址: http://www.djcxy.com/p/32647.html上一篇: Graph API shows Canvas items in Graph Explorer but not returned by PHP SDK