Facebook墙不是所有人都可以看到的

时间:2012-05-02 07:36:11

标签: android 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();
     }
}

2 个答案:

答案 0 :(得分: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){}

答案 1 :(得分:0)

你应该在你的参数中添加一个名为privacy的字符串,如下所示:

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

有关详细信息,请尝试阅读Facebook Post reference page