我正在尝试使用Facebook PHP SDK将墙上的帖子定位到我的粉丝页面。
下面的代码片段成功地在我的墙上发布了一条消息,但是地理目标没有被接受。
我是编程新手,我已经尽了最大努力遵循文档here,但它非常稀疏--我不确定我的语法是否正确。
任何帮助都将不胜感激。
//compiling the geotargeting parameters
$geoTarget = "{'cities':'Richmond,VA','regions':'Virginia','countries':'US'}";
//my arguments
$args = array(
'access_token' => $page_access_token,
'message' => "this is my message",
'targeting' => $geoTarget
);
//posts the message
$facebook->api("/$page_id/feed","post",$args);发布于 2012-01-13 00:33:50
此字段在Post表中为privacy
描述字段可以包含逗号分隔的有效国家、城市和语言列表,如果指定了按位置/语言定位的页面的帖子。
http://developers.facebook.com/docs/reference/api/post/
发布于 2012-08-10 13:46:55
为了简单起见,这就是您需要的http://developers.facebook.com/docs/reference/api/page/#targeting
这也会给出如何定位区域的信息。http://developers.facebook.com/docs/reference/ads-api/get-autocomplete-data/
要完成问题中的目标,您需要:
比特的国家是对的。弗吉尼亚州的地区代码是51 (可以通过搜索_“>https://graph.facebook.com/search?q=vi&type=adregion&match_country_code=true&country_list=US&access_token=_找到)里士满的城市id是2538983 (可以通过搜索_”>https://graph.facebook.com/search?q=richmon&type=adcity&limit=150&access_token=_找到)
因此,地理目标应该是
$geoTarget = "{'cities':[2538983],'regions':[51],'countries':'US'}";https://stackoverflow.com/questions/7893981
复制相似问题