Facebook SDK的Share Dialog(PHOTO)无效

时间:2014-12-04 10:24:52

标签: android facebook share

我尝试了以下代码

 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值真实

1 个答案:

答案 0 :(得分:0)

检查清单

<provider
        android:name="com.facebook.NativeAppCallContentProvider"
        android:authorities="com.facebook.app.NativeAppCallContentProvider1576508475912674"
        android:exported="true" />

用你的fbID替换“1576508475912674”