简体   繁体   English

Facebook在使用ACTION_SEND意图时在Android上剪辑文本

[英]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: 对于l10n,这是我在strings.xml资源上定义的文本:

<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. 请注意,Gamename和gamepackage不是我正在使用的实际游戏包。

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". 游戏是一个Activity,context是一个Application上下文,game_sharing_score_title是活动的标题“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. 无论如何,它自己的代码没有任何问题,它可以通过Google+,WhatsUp或Twitter进行分享,但是当用户选择通过FaceBook共享时,文本被剪切并且只发布最后一个链接,包含信息和FB从Google Play收集的一个图标图像,忽略链接之前的所有文本。

It is pretty clear that the problem is just with Facebook, no with the code or the string. 很明显,问题只在于Facebook,没有代码或字符串。

What I would like to find is some kind of workaround, if exists, to avoid these FB problems. 我想要找到的是某种解决方法,如果存在,以避免这些FB问题。 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. 说实话,我不喜欢Facebook,但它是一个拥有数百万人的社交网络,我不能简单地在游戏中忽略它。

Thanks a lot in advance, 非常感谢提前,

  1. Create Facebook app on your account 在您的帐户上创建Facebook应用
  2. After that, you get the App id. 之后,您将获得App id。
  3. Access all methods from Facebook API. 从Facebook API访问所有方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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