发布类型为Reference的对象 [英] Post an object of type Reference
问题描述
我已经有一段时间这个问题了,而且我也看到其他人也有这个问题.它必须处理发布在Open Graph中创建的自定义对象,以与应用程序一起发布.我主要在所有平台上都遇到这个问题,但是现在让我们说我正在使用Android.如果有人用C#或IOS甚至PHP做到了这一点,请发表您的答案.
I have had this problem for some time now and I have seen others have it as well. It has to deal with posting your custom objects that you create in Open Graph to post with your application. I am having this problem primarily on all platforms, but right now let's say I am using Android. If someone has accomplished this in C# or on IOS or even in PHP please post your answer.
一个例子:
我有一个物体可以将餐点发布到Facebook.假设它的属性如下.
I have an object that posts a meal to Facebook. Let's say its properties are the following.
mealName = "Lunch"
mealType = "Vegetarian"
mealLocation = "Somewheresville, OH"
现在,我的打开图中"有另一个对象,称为"DailyFood".它具有如下属性.
Now I have another object in my Open Graph and it is called DailyFood. It has properties such as the following.
day = "12/01/2012"
meal = "MyCustomMeal" // This references a meal object
现在,当我去张贴文章时,我尝试使用Java进行以下操作.
Now when I go to post that I try to do the following in Java.
//Build Meal
JSONObject mealData = new JSONObject();
mealData.put("mealName", "Lunch");
mealData.put("mealType", "Vegetarian");
mealData.put("mealLocation", "Somewheresville, OH");
Bundle params = new Bundle();
params.putString("day", "12/01/2012");
params.putString("meal", mealData.ToString());
AsyncFacebookRunner request = new AsyncFacebookRunner(facebook);
这是我生成以下错误代码的地方.
This is where I generate the following error code.
{"error":
{"message":"(#3503) is an invalid value for property
\"meal\" with type \"Reference\"","type":"OAuthException","code":3503}}
现在,我知道它显示OAuthException,但是我可以使用此应用将提要发布到Facebook.如果其他任何人在任何平台上都遇到此错误并找到了解决方案,请在此处发布.
Now I know that it says OAuthException but I am able to post feeds to Facebook with this app just fine. If anyone else has experienced this error on any platform and has found a solution please post it here.
谢谢!
推荐答案
因此,此问题的答案是,您实际上需要一个可用于您的应用程序的网站,才能引用其在Facebook上发布的内容.至少在文档中,我无法找到注释的地方.
So the answer to this question is that you actually need a website available for your app to be able to reference what its posting to Facebook. In the docs, I at least, wasn't able to find out where this was noted.
这篇关于发布类型为Reference的对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!