我想通过facebook sdk分享只有文字。我研究了更多时间,但通常使用 ShareLinkContent 类。它的工作,但我不想添加链接只发布文本到用户墙通过 ShareButton 。我该怎么做?
代码:
ShareLinkContent content = new ShareLinkContent.Builder()
.setContentDescription(Html.fromHtml(shareText).toString())
.setContentUrl(Uri.parse("http://developers.facebook.com/android"))
.build();
ShareApi.share(content, new FacebookCallback<Sharer.Result>() {
@Override
public void onSuccess(Sharer.Result result) {
Toast.makeText(activity, "Success..", Toast.LENGTH_LONG).show();
}
@Override
public void onCancel() {
Toast.makeText(activity, "Cancel..", Toast.LENGTH_LONG).show();
}
@Override
public void onError(FacebookException e) {}
});
shareButton.setFragment(this);
shareButton.setShareContent(content);
FacebookSDK:4.11.0