使用 sdk 在 Facebook 上分享文本
Share text on Facebook using sdk
我正在开发一个 android 应用程序,我在其中分享 Facebook 上的内容。我可以分享 link,图片。但是当我在 Facebook 上只有 post 文本时,我无法发送。我没有得到任何东西。我正在使用以下代码在 Facebook 上分享。
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();
请参阅提要对话框的文档:https://developers.facebook.com/docs/sharing/reference/feed-dialog/v2.2
如您所见,没有消息 属性。这是因为为用户预填充状态更新违反了平台政策。
我正在开发一个 android 应用程序,我在其中分享 Facebook 上的内容。我可以分享 link,图片。但是当我在 Facebook 上只有 post 文本时,我无法发送。我没有得到任何东西。我正在使用以下代码在 Facebook 上分享。
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();
请参阅提要对话框的文档:https://developers.facebook.com/docs/sharing/reference/feed-dialog/v2.2
如您所见,没有消息 属性。这是因为为用户预填充状态更新违反了平台政策。