简体   繁体   中英

Facebook on Android exits immediately when sharing with it from my app

When I share some URL (as text) from my app with Facebook, the Facebook new post activity appears and exits immediately and my app re-appears. The user has no chance to submit it, or even review and finish it. This is (apparently) not a crash, there is no notification about Facebook app crashing. When shared with some other app (eg Gmail), it works fine.

Unfortunately this only happens on some devices. All devices where I tested it have the same version of the Facebook app. It's not related to Android version (tested on two 4.4 devices, one of them is OK and one is not).

This is what I'm doing in my app:

String textToShare = "http://lovelikeorhate.eu/question/LOVE/3";
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, textToShare);
sendIntent.putExtra("com.facebook.platform.extra.APPLICATION_ID", getString(R.string.facebook_app_id));
sendIntent.setType("text/plain");
startActivity(Intent.createChooser(sendIntent, getResources().getText(R.string.send_to)));

Any ideas what might be wrong? The URL is applinks enabled, could it be related?

The app needs to be in production mode on Facebook. This is the same problem: ClassNotFoundException on opening facebook share icon in android

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM