2

In my Android application I want to share text message using Facebook share dialog screen with pre populated text but I get only share dialog without pre populated text. For example I want to post the text "User wants this pop up..." but the Facebook share dialog does not show my message in the dialog.

My question is what should I need to get share dialog with my pre populated text?

I have tried the following code:

FacebookDialog shareDialog = new 
FacebookDialog.ShareDialogBuilder(FShareActivity.this)
                        .setLink(msg_link)
                        .setCaption(msg_caption)
                        .setDescription(msg_description) // msg_description should be shown in share dialog screen & it is my pre populated text.
                        .setName(msg_name).build();
                uiHelper.trackPendingDialogCall(shareDialog.present());

and also tried this method also

Bundle params = new Bundle();
params.putString("name", msg_name);
params.putString("caption", msg_caption);
params.putString("description", msg_caption);
params.putString("link", msg_link);
WebDialog feedDialog = (
    new WebDialog.FeedDialogBuilder(getActivity(),
        Session.getActiveSession(),
        params))
    .setOnCompleteListener(new OnCompleteListener() {
        @Override
        public void onComplete(Bundle values,
            FacebookException error) {
            if (error == null) {
                final String postId = values.getString("post_id");
                if (postId != null) {
                  // success
                } else {
                    // fail
                }
            }
        }
    })
    .build();
feedDialog.show();

Please let me know Is it possible to show pre populated text in share dialog screen? if yes Please tell me what did I wrong?

4

1 回答 1

0

ShareDialogBu​​ilder 上的设置描述不会预先填充用户将要共享的实际消息。设置描述仅设置要共享的 URL 的描述,并将其添加到对话框中显示的附件中。它不会预先填充用户文本。

预先填写用户消息是违反 Facebook 政策的。

请勿在帖子的标题、评论、消息或用户消息参数中预先填充非个人创建的内容,即使此人可以在共享前编辑或删除内容。

https://developers.facebook.com/policy/

于 2015-03-12T00:40:25.007 回答