从Android应用程序在Facebook上发布分数
我正在使用以下代码。当我选择twitter应用程序时,它会在推特对话框中显示“我的分数是2000”文本,但在Facebook帖子对话框中不会显示文本从Android应用程序在Facebook上发布分数,android,Android,我正在使用以下代码。当我选择twitter应用程序时,它会在推特对话框中显示“我的分数是2000”文本,但在Facebook帖子对话框中不会显示文本 Intent shareIntent=new Intent(Intent.ACTION_SEND); shareIntent.setType("text/plain"); shareIntent.putExtra(Intent.EXTRA_TEXT,"My score is with snake game is 2000"); shareInten
Intent shareIntent=new Intent(Intent.ACTION_SEND);
shareIntent.setType("text/plain");
shareIntent.putExtra(Intent.EXTRA_TEXT,"My score is with snake game is 2000");
shareIntent.putExtra(Intent.EXTRA_SUBJECT, "The title");
startActivity(Intent.createChooser(shareIntent, "Share..."));
您的代码是正确的,但fb android应用程序没有(正确地)实现API。我找到的唯一解决方案是使用fb android sdk(com.facebook.android):
Facebook不允许您为用户设置消息。这是一个众所周知的问题,以前曾多次被问及。Facebook已经开始允许你预先填充信息(至少在iOS 6+原生FB共享中)。也许这会在将来被打开 看
Bundle parameters = new Bundle();
parameters.putString("caption", "The title");
parameters.putString("description", "My score is with snake game is 2000");
facebook.dialog(this, "feed", parameters, this);