我正在尝试将我的 Open Graph 操作发布到墙上。所有的元标记都设置好了,但我不知道,我应该在这个命令中添加哪个参数:
$facebook->api('/me/APP_URL_NAME:action_name','POST', array('image'=>$meta_shoe_image));
返回:
Fatal error: Uncaught Exception: The action you're trying to publish is invalid because it does not specify any reference objects. At least one of the following properties must be specified: OBJECT_NAME. thrown in _FB_LIBRARY_
当我尝试
$facebook->api('/me/APP_URL_NAME:action_name','POST', array('OBJECT_NAME'=>'http://apps.facebook.com/APP_URL_NAME:action_name', 'image'=>$meta_shoe_image));
返回
Fatal error: Uncaught OAuthException: (#3502) Object at URL http://apps.facebook.com/APP_URL_NAME/ has og:type of 'website'. The property 'shoe' requires an object of og:type 'APP_URL_NAME:OBJECT_NAME'. thrown in _PATH_TO_FB_LIBRARY_
我在做什么还是错的?我在哪里可以得到,应该是'OBJECT_NAME'=>'_HERE_'
什么?
编辑:另外,当我尝试获取当前 URL 地址并将其推送到 Facebook 函数时:
function curPageURL() {
$pageURL = 'http://';
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pageURL;
}
$facebook->api('/me/APP_URL_NAME:action_name','post', array('OBJECT_NAME' => curPageURL(), 'image' => $meta_shoe_image));
我明白了
Fatal error: Uncaught Exception: Could not retrieve data from URL. thrown in _FB_FILE_