1

我正在尝试在我的墙帖中标记一位朋友。但是这个“标签”参数不起作用。我如何标记一个/​​多个朋友?请帮助我。先感谢您。

            Bundle params = new Bundle();

            params.putString("tags", tagged_friends_id);

             WebDialog feedDialog = (new WebDialog.FeedDialogBuilder(this, 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) {
                                    Toast.makeText(MainActivity.this,"Posted story, id: "+postId, Toast.LENGTH_SHORT).show();
                                } 
                                else {
                                    // User clicked the Cancel button
                                    Toast.makeText(MainActivity.this,  "Publish cancelled", Toast.LENGTH_SHORT).show();
                                }
                            } 
                            else if (error instanceof FacebookOperationCanceledException) {
                                // User clicked the "x" button
                                Toast.makeText(MainActivity.this,  "Publish cancelled", Toast.LENGTH_SHORT).show();
                            } 
                            else {
                                // Generic, ex: network error
                                Toast.makeText(MainActivity.this, "Error posting story", Toast.LENGTH_SHORT).show();
                            }
                        }

                    }).build();
                feedDialog.show();
4

3 回答 3

1

您可以使用“标签”键本身标记多个朋友。但是语法需要有点不同。朋友 ID 必须附加在以逗号分隔的字符串中。id 之间不应有任何空格。

例如:

params.putString("tags", "xxxxx1,xxxxx2");

这对我来说非常有效。

于 2013-12-19T05:09:59.990 回答
0

请参阅此处的 Feed 对话框支持的参数的文档:

https://developers.facebook.com/docs/reference/dialogs/feed/

Feed 对话框不支持“标签”。

于 2013-10-02T22:20:40.147 回答
0

正如 Ming 所提到的,您不能使用Feed Dialog标记朋友。

在帖子中标记朋友的唯一方法是使用 Open Graph 概念 -提及标记

于 2013-10-03T07:05:11.900 回答