Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook clipping text on Android when using an ACTION_SEND intent

I have added code to my casual game to share highest score through social networks, email, etc.

This is the text I send as defined on strings.xml resouce, for l10n:

<string name="game_sharing_score" formatted="false">
    My new High Score on Gamename: %d\n
    You can download Gamename from here:\n
    https://play.google.com/store/apps/details?id=gamepackage
</string>

Please, note that Gamename and gamepackage are not the actual ones that I am using.

The code for sharing is the following one:

    String shareScoreMsg = String.format(context.getString(R.string.game_sharing_score), highestScore);
    Intent shareScoreInt = new Intent(Intent.ACTION_SEND);
    shareScoreInt.setType("text/plain");
    shareScoreInt.putExtra(Intent.EXTRA_TEXT, shareScoreMsg);

    game.startActivity(Intent.createChooser(shareScoreInt, context.getString(R.string.game_sharing_score_title)));

game is an Activity, context is an Application context, game_sharing_score_title is the title of the activity "Share your score". Anyway there is no problem with the code it self, it is working fine for sharing through Google+, WhatsUp or Twitter, but when the user selects to share through FaceBook, the text is clipped and it publish only the last link, with the information and one icon image that FB gathers from Google Play, ignoring all the text before the link.

It is pretty clear that the problem is just with Facebook, no with the code or the string.

What I would like to find is some kind of workaround, if exists, to avoid these FB problems. To be honest, I do not like Facebook, but it is a social network with millions of people and I cannot simply ignore it on my game.

Thanks a lot in advance,

like image 706
Fran Marzoa Avatar asked Jul 15 '12 12:07

Fran Marzoa


1 Answers

  1. Create Facebook app on your account
  2. After that, you get the App id.
  3. Access all methods from Facebook API.
like image 117
sachin10 Avatar answered Sep 20 '22 04:09

sachin10