I have switched to use the newly updated Facebook SDK for Android.
The above message was given in an FacebookException class when I tried to use the new Share Dialog.
Any reason why this happens?
Here's the code I'm using.
OpenGraphAction action = GraphObject.Factory.create(OpenGraphAction.class);
action.setProperty("object", "http://object.url");
FacebookDialog shareDialog = new FacebookDialog.OpenGraphActionDialogBuilder(this, action, "appnamespace.action", "object")
.build();
uiHelper.trackPendingDialogCall(shareDialog.present());
I believe the issue is related to the "
previewPropertyName
" field int heOpenGraphActionDialogBuilder
constructor.This must match the name of the property in the action that points to the
OpenGraphObject
itself. exampleAfter hours and hours of trial and error, I've finally figured this out. Wish it was much simpler though. Facebook should provide a code generator.
Anyways, the solution for my problem is that the action word has to match the one that facebook set perfectly. The only way to see this is at the open graph code generator for types.
https://developers.facebook.com/apps/{app-id}/opengraph/types
You can find it at the above link at the action types section.
Now, take the namespace and action type that facebook provided and replace it with "appnamespace:action" below.