So I have a Facebook webpage app, and I'm trying to use the Facebook Javascript SDK and the FB.ui function to post a custom Open Graph story on a user's wall.
I have a custom action 'Ride' and custom object 'Distance'. I am trying to post a custom story 'Ride a Distance'.
My function below is triggered on the click of a button:
function postDistanceRidden() {
FB.ui({
method: 'share_open_graph',
action_type: 'APP_NAME:ride',
action_properties: JSON.stringify({
distance:{
"og:type" : "APP_NAME:distance",
"app_id" : "APP_ID",
"og:url" : 'PUBLIC_URL',
"og:title" : "My Title",
"og:image" : "PUBLIC_IMAGE_URL",
"APP_NAME:distance_value" : "10",
"APP_NAME:distance_unit" : "miles",
},
})
}, function(response){});
}
When I click the button and run the function above, I get a Facebook popup window with the following error: "Action Requires At Least One Reference: 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: distance."
I'm not sure what I'm doing wrong. Furthermore, I have tried the above code with replacing my custom actions/objects with Facebook defined ones, and it worked (for example, 'liking' an 'article'). Any help would be greatly appreciated. Please tell me if I need to provide more information.
Thanks!