0

您好,我正在使用下面的代码将墙发布到我的 facebook,它会将墙添加到我的 facebook,但是

我的朋友看不到。我怎样才能做到这一点

public void postOnWall(String songtitle,String artist,String location,String desc) {
    String msg=desc+" at "+location+" listening to "+songtitle+" by "+artist;
    String description="Share your memories with the all new social map!";
     try {
            String response;
            Bundle parameters = new Bundle();
            parameters.putString("message",msg);
            parameters.putString("description",description);
            parameters.putString("link","");
            parameters.putString("name","");
            response = mFacebook.request("me/feed", parameters,"POST");

            Log.d("Tests", "got response: " + response);
            if (response == null || response.equals("") || 
                    response.equals("false")) {
               Log.v("Error", "Blank response");
            }
     } catch(Exception e) {
         e.printStackTrace();
     }
}
4

2 回答 2

1

试试这个片段让你的帖子对所有用户可见:

       try{
         String msg=desc+" at "+location+" listening to "+songtitle+" by "+artist;
         String description="Share your memories with the all new social map!";
         Bundle parameters = new Bundle();
         JSONObject attachment = new JSONObject();

         try {
            attachment.put("name", "");
            attachment.put("href", link);
            attachment.put("message",msg);
            attachment.put("description",description);
         } catch (JSONException e) {    }   
         parameters.putString("attachment", attachment.toString());
         parameters.putString("method", "stream.publish");
         parameters.putString("target_id", "Your Used ID"); // Optional
         String  response = mFacebook.request(parameters);       
      }
    catch(Exception e){}
于 2012-05-02T09:39:32.833 回答
0

您应该像这样添加一个调用参数的字符串privacy

       parameters.putString("privacy","friends");

有关更多信息,请尝试阅读Facebook 帖子参考页面

于 2012-05-02T07:41:52.327 回答