Java 使用sdk在Facebook上共享文本
我正在开发一个android应用程序,在其中我在facebook上共享内容。我可以分享链接,图片。但当我只在facebook上发布文本时,我无法发送。我什么也没得到。我使用以下代码在facebook上分享Java 使用sdk在Facebook上共享文本,java,android,eclipse,facebook,Java,Android,Eclipse,Facebook,我正在开发一个android应用程序,在其中我在facebook上共享内容。我可以分享链接,图片。但当我只在facebook上发布文本时,我无法发送。我什么也没得到。我使用以下代码在facebook上分享 Bundle bundle = new Bundle(); bundle.putString("name", webPageContent); bundle.putString("message", webPageContent); FeedDialogBuilder feedDialog =
Bundle bundle = new Bundle();
bundle.putString("name", webPageContent);
bundle.putString("message", webPageContent);
FeedDialogBuilder feedDialog = new WebDialog.FeedDialogBuilder(FacebookShareActivity.this,Session.getActiveSession(),bundle)
.setOnCompleteListener(new OnCompleteListener() {
@Override
public void onComplete(Bundle values,
FacebookException error) {
// TODO Auto-generated method stub
if (error == null) {
// When the story is posted, echo the success
// and the post Id.
final String postId = values.getString("post_id");
if (postId != null)
{
Toast.makeText(FacebookShareActivity.this, "Posted story, id: "+postId, Toast.LENGTH_SHORT).show();
}
}
}
});
feedDialog.build().show();
有关提要对话框,请参见文档: 如您所见,没有消息属性。这是因为为用户预先填充状态更新是违反平台策略的