Skip to content

Instantly share code, notes, and snippets.

@JohnMars
Last active August 29, 2015 14:11
Show Gist options
  • Select an option

  • Save JohnMars/89f3c5c08b38c63bcc33 to your computer and use it in GitHub Desktop.

Select an option

Save JohnMars/89f3c5c08b38c63bcc33 to your computer and use it in GitHub Desktop.
Sharing on Facebook with images
OpenGraphObject object = OpenGraphObject.Factory.createForPost("application:object");
recipe.setProperty("title", "your title");
recipe.setProperty("description", "your description");
OpenGraphAction action = GraphObject.Factory.create(OpenGraphAction.class);
action.setType("application:share");
action.setProperty("object", object);
action.setProperty("message", "your message");
FacebookDialog shareDialog = new FacebookDialog.OpenGraphActionDialogBuilder(this, action, "object")
//attaching image array list to share
.setImageAttachmentsForObject("image", images, true)
.build();
uiHelper.trackPendingDialogCall(shareDialog.present());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment