StuStirling
StuStirling

Reputation: 16221

Share Intent Not Working With Facebook Messenger

I am send an Intent with the action Intent.ACTION_SEND. This works fine and the user can pick what application to share with and so on.

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

Here is the code that launches 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 get that Facebook don't allow pre filled text when you use the share intent so my "Check out this app" text is removed. I don't understand however why the Facebook Messenger app is not doing anything however.

Any ideas anyone? Can you see anything wrong with my intent?

Upvotes: 3

Views: 2772

Answers (2)

Uday Patel
Uday Patel

Reputation: 11

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"));

1.your package name display in 1st line of your file

2.your image int value from srting which want to share

"com.facebook.orca" is facebook massanger package

Its work for me,hope your also

Upvotes: 1

kautilya
kautilya

Reputation: 1

put only link, do not add text with link.

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

Upvotes: 0

Related Questions