1

我想在墙贴上标记一个朋友。但是这个'标签'参数不起作用。我如何标记一个/​​多个朋友?请帮助我。先谢谢你。如何在android中使用facebbok sdk在墙贴中标记好友?

  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(); 

回答

0

正如Ming所提到的,您不能使用Feed对话框标记好友。

在后标记朋友的唯一方法,是使用的Open Graph Concept- Mention Tagging

+0

谢谢Sahil。 ... – Afzal

1

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

对于如:

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

这非常适合我。

+0

你的意思是说,它可以用于对话框 – Sunny

+0

它适用于无声帖子。 – Ankita

+0

通过使用你的代码我得到一个错误“error_code”:100,“error_msg”:“param标签必须是非空的 – jyomin

相关问题