Share Intent not working with Facebook Messenger

I send Intent

with action Intent.ACTION_SEND

. This works great and the user can choose which app to share, etc.

The problem is when they choose Facebook Messenger to share. All I get is a white, modal screen with "Submit" in the top left and a search icon in the top right.

Here is the code that triggers the intent.

Intent appIntent = new Intent(Intent.ACTION_SEND);
appIntent.setType("text/plain");
appIntent.putExtra(Intent.EXTRA_TEXT,"Check out this app. \nhttp://www.boxshark.co.uk");
appIntent.putExtra(Intent.EXTRA_SUBJECT,"Get the Boxshark app");
startActivity(Intent.createChooser(appIntent,"Share"));

      

I am getting that Facebook does not allow pre-filled text when you use a sharing intent, so the text "Check out this app" is removed. However, I don't understand why the Facebook Messenger app is not doing anything.

Any ideas? Do you see something wrong with my intentions?

+3


source to share


2 answers


PackageManager pm=getPackageManager();

Intent i = new Intent(Intent.ACTION_SEND);
i.setType("image/jpeg");
Uri uri = Uri.parse("android.resource://1/"+2);
i.putExtra(Intent.EXTRA_STREAM, uri);
PackageInfo info=pm.getPackageInfo("com.facebook.orca", PackageManager.GET_META_DATA);
i.setPackage("com.facebook.orca");
startActivity(Intent.createChooser(i, "Share with"));

      

Displaying your package name on the 1st line of your file

2.Select int value from srting you want to split



"com.facebook.orca" is a facebook massanger package

Its work for me, I hope you do too

+1


source


place only the link, do not add text with the link.



appIntent.putExtra(Intent.EXTRA_TEXT,"http://www.boxshark.co.uk") 

      

0


source







All Articles