Reputation: 11
I am currently trying out the Facebook for Android Share Dialog(https://developers.facebook.com/docs/android/share-dialog/) that was introduced in Facebook for Android SDK 3.5.
The code for starting the dialog is straight forward:
FacebookDialog shareDialog = new FacebookDialog.ShareDialogBuilder(this)
.setLink("https://developers.facebook.com/android")
.build();
uiHelper.trackPendingDialogCall(shareDialog.present());
Similar to setLink() there is a setPicture(String url) method in FacebookDialog.ShareDialogBuilder. But I can't get this setPicture() method to work. I have tried to put Url to local image files, online images and also FB staged images (fbstage://...) but nothing seems to make any effect on the Share Dialog viewed or the resulting post.
Is there anyone that got the setPicture() method to work?
Upvotes: 1
Views: 5906
Reputation: 1
In order for you to call the setPicture() should be used with setLink().
Please refer to the article below. https://developers.facebook.com/docs/reference/android/current/class/FacebookDialog.ShareDialogBuilder/
Upvotes: 0
Reputation: 319
With ShareDialogBuilder
its not permitted to shared a local file but only remote files.
Currently I think that the only way (via a share dialog) is through the open graph action dialog.
Upvotes: 1
Reputation: 1660
You need to use an external URL like:
.setPicture("http://yourdomain.com/images/xyz.png");
Also, it will only display if you've set the link.
Upvotes: -1
Reputation: 4683
from documentation of facebook feed
The picture must be at least 200px by 200px.
And even more restriction on image to be, check here
This is an image associated with your media. We suggest that you use an image of at least 200x200 pixels. However, bigger is better, so if you have a 1500x1500 image that you can use, please use it. We'll downsample and crop it for for people using smaller-resolution devices but will use it on a larger device. The larger this image is, the more likely it will be used when sharing stories on Facebook. (Note: image sizes must be no more than 5MB in size.)
Upvotes: 1