我在与Facebook的PHP SDK 4.0版的问题。
我只是想找回insights/page_fans_city
通过图形API指标:
$request = new FacebookRequest($session, 'GET',
'/{my object}/insights/page_fans_city',
array('period' => 'lifetime'));
$response = $request->execute();
$client_graph_object = $response->getGraphObject();
print_r($client_graph_object);
但是,在返回任何数据:
Facebook\GraphObject Object
(
[backingData:protected] => Array
(
[data] => Array
(
)
[paging] => stdClass Object
(
[previous] => https://graph.facebook.com/v2.0/...
[next] => https://graph.facebook.com/v2.0/...
)
)
)
我知道,我有我请求解析数据。 我可以通过图形浏览器完全一样的要求:
→/v.2.0/{my对象} /见解/ page_fans_city?周期=寿命
{
"data": [
{
"id": "{my object}/insights/page_fans_city/lifetime",
"name": "page_fans_city",
"period": "lifetime",
"values": [
{
"value": {
...
},
"end_time": "2014-08-01T07:00:00+0000"
},
{
"value": {
...
},
"end_time": "2014-08-02T07:00:00+0000"
}
],
"title": "Lifetime Likes by City",
"description": "Lifetime: Aggregated Facebook location data, sorted by city, about the people who like your Page. (Unique Users)"
}
],
"paging": {
"previous": "https://graph.facebook.com/v2.0/...,
"next": "https://graph.facebook.com/v2.0/...
}
}
我要指出, 我收到的数据,如果我省略page_fans_city
段。 当它被略去我可以查看数据page_fans_country
只。 因此
$request = new FacebookRequest($session, 'GET',
'/{myobject}/insights/page_fans_country',
array('period' => 'lifetime'));
和
$request = new FacebookRequest($session, 'GET',
'/{myobject}/insights',
array('period' => 'lifetime'));
将工作对我来说...
我怀疑这是我的访问令牌的,但我不知道为什么会是这样。 我创建的应用程序只需要read_insights
许可。
任何想法或建议?
提前致谢,
麦克风