3
votes

I am using the below code. It opens the Facebook Messenger app, but the image is not shown (with broken image symbol) and sending fails.

List<Bitmap> abc = new ArrayList<Bitmap>();
abc.add(pic);
FacebookDialog.PhotoMessageDialogBuilder builder = new FacebookDialog.PhotoMessageDialogBuilder(LocationShare.this);
builder.addPhotos(abc);
builder.build().present();

is there any problem in the way i add photos? i mean using List i have mentioned content provider in android manifest.xml i am able send link using below code.

FacebookDialog.MessageDialogBuilder builder = new FacebookDialog.MessageDialogBuilder(getActivity()) .setLink("https://developers.facebook.com/docs/android/share/") .setName("Message Dialog Tutorial") .setCaption("Build great social apps that engage your friends.") .setPicture("http://i.imgur.com/g3Qc1HN.png") .setDescription("Allow your users to message links from your app using the Android SDK.");

1

1 Answers

2
votes

Did you add a content provider?

If you look at the javadocs for addPhotos (https://developers.facebook.com/docs/reference/android/current/class/FacebookDialog.PhotoMessageDialogBuilder/#addPhotos) it says that a NativeAppCallContentProvider must be specified in your AndroidManifest.

In the docs for NativeAppCallContentProvider (https://developers.facebook.com/docs/reference/android/current/class/NativeAppCallContentProvider/) it tells you how to add the content provider.

You can also have a look in the HelloFacebook sample which has an example of adding the content provider in the AndroidManifest.