我目前正在尝试Facebook for Android Share Dialog(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());
与setLink()类似,FacebookDialog.ShareDialogBuilder中有一个setPicture(String url)方法。但是我不能让这个setPicture()方法起作用。我试图将Url放到本地图像文件,在线图像以及FB暂存图像(fbstage:// ...),但似乎没有任何效果对查看的共享对话框或结果帖子产生任何影响。
有没有人让setPicture()方法起作用?
答案 0 :(得分:1)
The picture must be at least 200px by 200px.
对图像的限制更多,请检查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.)
答案 1 :(得分:1)
ShareDialogBuilder
不允许共享本地文件,只能共享远程文件。
目前我认为唯一的方法(通过共享对话框)是通过打开图形操作对话框。
答案 2 :(得分:0)
为了调用setPicture(),应该与setLink()一起使用。
答案 3 :(得分:-1)