2

I'm currently trying to create a FacebookDialog that posts with a local image. I am able to create the dialog with the image and post it, but the "user generated" flag appears to be ignored.

What I'm getting is this:
facebook small image

...when it should look like this:

enter image description here

The NativeAppCallContentProvider has been set in the manifest and the "User Generated Photos" option has been enabled in the Open Graph Action

Here is the code I'm using...

OpenGraphObject ogObject = OpenGraphObject.Factory.createForPost("app:objectName");
ogObject.setTitle("title");
ogObject.setDescription("description");

// Prepare the action
OpenGraphAction ogAction = OpenGraphAction.Factory.createForPost("app:actionName");
ogAction.setProperty("objectName", ogObject);

// Prepare the image
Bitmap imageBitmap = ...
List<Bitmap> photoBitmaps = new ArrayList<>();
photoBitmaps.add(imageBitmap);

FacebookDialog shareDialog = new FacebookDialog.OpenGraphActionDialogBuilder(this, ogAction, "objectName")
    .setImageAttachmentsForObject("objectName", photoBitmaps, true) // user generated is set 'true' 
    .build();
mUiHelper.trackPendingDialogCall(shareDialog.present());

edit:

I ran the Scrumptious sample app from the Facebook SDK and it's the exactly the same. The "user_generated" property is set to "true", but the picture still appears as a thumbnail.

loadedion
  • 2,217
  • 19
  • 41
  • How big are these images (width x height)? Have you tried setting the image attachment on the action rather than the object? – Ming Li Mar 03 '15 at 02:12
  • @MingLi I've tried images of variable height, but they have all been larger than 480x480. I initially received an error stating that the images were too small. Setting the image on the action requires `URLs` or `JSONObjects`, which I do not have. – loadedion Mar 03 '15 at 17:38
  • Interesting, you should file a bug at https://developers.facebook.com/bugs with repro steps, and one of our support engineers will have a look. – Ming Li Mar 03 '15 at 18:04
  • @MingLi Actually, I tried `.setImageAttachmentsForAction(photoBitmaps, true)` and while an image appears in the dialog preview, there is no image at all in the post itself. Could that be related? – loadedion Mar 03 '15 at 19:11
  • I am having the same issue. I am testing using a facebook test user. Make sure you have the user generated photo checkbox in your app dashboard checked. I wonder if you need to have your action approved by Facebook before you can use the user generated feature? – jiawen Mar 14 '15 at 01:08
  • I'm afraid it is a bug. The Scrumptious sample app that comes with the Facebook SDK doesn't work either. – loadedion Mar 15 '15 at 02:50
  • Any news on this? This is incredibly frustrating. – fatuhoku May 13 '15 at 11:13
  • Nope. https://developers.facebook.com/bugs/894961473857663 – loadedion May 13 '15 at 17:49

0 Answers0