分享对话框的Facebook SDK(组图)不工作
问题描述:
我尝试下面的代码分享对话框的Facebook SDK(组图)不工作
List<File> list = new ArrayList<File>();
list.add(new File(uri.getPath()));
boolean canPresentShareDialogWithPhotos = FacebookDialog.canPresentShareDialog(mContext, FacebookDialog.ShareDialogFeature.PHOTOS);
Log.d(TAG, "canPresentShareDialogWithPhotos: " + canPresentShareDialogWithPhotos);
if (canPresentShareDialogWithPhotos) {
// Publish the post using the Photo Share Dialog
FacebookDialog shareDialog = new FacebookDialog.PhotoShareDialogBuilder((Activity) mContext)
.addPhotoFiles(list)
.build();
shareDialog.present();
} else {}
我得到canPresentShareDialogWithPhotos值true
答
检查清单
<provider
android:name="com.facebook.NativeAppCallContentProvider"
android:authorities="com.facebook.app.NativeAppCallContentProvider1576508475912674"
android:exported="true" />
替换 “1576508475912674” by your fbID
不适用于共享内容 – 2016-07-29 06:19:06