如何正确发布Open Graph操作? [英] How to correctly publish Open Graph action?

查看:80
本文介绍了如何正确发布Open Graph操作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将开放图谱"操作发布到墙上.所有元标记均已设置,但我不知道应在此命令中添加哪个参数:

I am trying to publish my Open Graph action to the wall. All meta tags are set up, but I don't know, which parameter I should add to this command:

$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_'应该是什么?

What am I doing still wrong? Where can I get, what should be 'OBJECT_NAME'=>'_HERE_'?

编辑:此外,当我尝试获取当前URL地址并将其推入Facebook功能时:

Also, when I try to obtain current URL address and push it into the Facebook function:

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_

推荐答案

致命错误:未捕获的OAuthException:(#3502)URL http://apps.facebook.com/中的对象APP_URL_NAME/具有og:类型的网站".属性"shoe"需要使用og:type"APP_URL_NAME:OBJECT_NAME"对象.抛出_PATH_TO_FB_LIBRARY _

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_

听起来您正在尝试将应用程序在Facebook上的画布页面URL用作要在其上发布操作的Open Graph对象.

That sounds like you are trying to use your app’s canvas page URL on Facebook as the Open Graph object you are trying to publish an action upon.

您无法做到–它必须是一个独立"网页,并且必须在meta标记中将其og:type设置为"APP_URL_NAME:OBJECT_NAME".

You can’t do that – it has to be a "stand-alone" web page, and it has to have it’s og:type set up in the meta tags as 'APP_URL_NAME:OBJECT_NAME'.

这篇关于如何正确发布Open Graph操作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆