2
votes

I've poured through the documentation, and it appears as though it is not possible to simply share a local user generated image through the ShareDialog provided in the SDK?

Can someone confirm if this is indeed the case? If it is possible, how can I do this? I only ask because it is possible to do this through OpenGraphActionDialogBuilder via setImageAttachmentsForAction, but not ShareDialogBuilder.(ex: Posting photo from a native ShareDialog in Facebook android SDK)

All I want to do is to post a status update with an image, I don't want to create link to another URL, which is required by the OpenGraphActionDialogBuilder.

1
This is correct, currently the only way (via a share dialog) is through the open graph action dialog.Ming Li
hmm that's a shame, it seems like an obvious feature to have. thanks for that though!Aneem

1 Answers

0
votes

It's an old question but here is my solution with the latest Facebook API:

Bitmap image = BitmapFactory.decodeResource(getResources(), R.drawable.scrat);
            SharePhoto photo = new SharePhoto.Builder()
                .setBitmap(image)
                .build();
            SharePhotoContent content = new SharePhotoContent.Builder()
                .addPhoto(photo)
                .build();

            ShareDialog dlg = new ShareDialog(MainActivity.this);
            if(dlg.canShow(SharePhotoContent.class)){
                dlg.show(content);
            }

Don't forget you have to be logged.