Post an object of type Reference

2019-04-11 06:07发布

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!

2条回答
Rolldiameter
2楼-- · 2019-04-11 06:45

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.

查看更多
叼着烟拽天下
3楼-- · 2019-04-11 06:47

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.

查看更多
登录 后发表回答