Posting user_generated photo from new native Share

2019-06-02 07:43发布

问题:

I'm, trying to post an image to the Facebook (with OpenGraph) using new SDK v3.5 Share Dialog described here

As a result I'm getting com.facebook.FacebookException: Error retrieving image attachment.

The image is added to the dialog like described in the documentation:

List<Bitmap> bitmaps = new ArrayList<Bitmap>();
bitmaps.add(bitmap);

FacebookDialog shareDialog = new FacebookDialog.OpenGraphActionDialogBuilder(ShareAwardActivity.this, action, "my_app:my_action", "my_object")
  .setImageAttachmentsForObject("my_object", bitmaps, true)
  .build();
facebookHelper.trackPendingDialogCall(shareDialog.present());

It looks like SDK stores image in the cache folder to be read by Facebook app, but Facebook app can't read or upload it somehow.

I tried setImageAttachmentsForAction - didn't help.

Also tried to add the image url to my_object - it doesn't respect the user_generated flag

Does anyone succeeded in doing this?