1

我目前正在试用 Facebook for Android 共享对话框 ( https://developers.facebook.com/docs/android/share-dialog/ ),它在 Facebook for Android SDK 3.5 中引入。

启动对话框的代码很简单:

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?

4

4 回答 4

1

ShareDialogBuilder不允许共享本地文件,而只能共享远程文件。

目前我认为唯一的方法(通过共享对话框)是通过打开图形操作对话框。

于 2014-06-27T08:26:11.677 回答
1

来自facebook feed的文档

The picture must be at least 200px by 200px. 

对图像的更多限制,请查看此处

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.)

于 2013-09-03T07:14:18.913 回答
0

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/

于 2015-01-29T05:17:57.383 回答
-1

您需要使用外部 URL,例如:

.setPicture(" http://yourdomain.com/images/xyz.png ");

此外,它只会在您设置了链接时显示。

于 2014-06-19T22:04:16.970 回答