Post an object of type Reference

。_饼干妹妹 提交于 2019-12-21 19:44:00

问题


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.

An Example:

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"

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

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}}

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.

Thanks!


回答1:


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.




回答2:


according to this official video you must have the web application to post the action using open graph,no matter in which platform we are working android,ios etc

as it fetches the meta tags and properties from the web url only which works as refrence.



来源:https://stackoverflow.com/questions/10271536/post-an-object-of-type-reference

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!