我想將我的Open Graph動作發佈到牆上。所有的meta標籤都設置了,但我不知道,我要補充這個命令,它的參數:如何正確發佈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_