i tried the following code
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 {}
i am getting canPresentShareDialogWithPhotos value true
Check your manifest
<provider
android:name="com.facebook.NativeAppCallContentProvider"
android:authorities="com.facebook.app.NativeAppCallContentProvider1576508475912674"
android:exported="true" />
replace "1576508475912674" by your fbID
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.