我正在尝试将我的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_
答案 0 :(得分:1)
致命错误:未捕获OAuthException:(#3502)URL http://apps.facebook.com/APP_URL_NAME/处的对象具有og:'website'类型。属性“鞋”需要一个og对象:输入“APP_URL_NAME:OBJECT_NAME”。抛出_PATH_TO_FB_LIBRARY _
听起来您正试图在Facebook上使用应用的画布页面网址作为您尝试发布操作的Open Graph对象。
你不能这样做 - 它必须是一个“独立”的网页,它必须有og:在元标记中键入“APP_URL_NAME:OBJECT_NAME”。