2011-11-17 128 views
0

我想張貼在Facebook塗鴉牆留言,我的Facebook集成SDK在我的項目,我是編碼這樣的,但在Facebook上牆沒有消息顯示,但這些信息是從我的應用程序來...... 這是在我使用過賬,如何在FaceBook牆上發佈信息?

public void updateStatus(String accessToken, String message){ 

     System.out.println("mes is "+message);   
     Bundle bundle = new Bundle();  
     bundle.putString("message", message);      
     facebook.dialog(this, "stream.publish", bundle, this); 

} 

回答

0

我有同樣的問題。

消息:我從什麼是在Facebook上facebook.dialog()方法的消息場的documentation提到下面的搜索找到了「這個領域將在2011年7月12日被忽略預填的文本字段的消息用戶將輸入。要符合Facebook平臺政策,如果用戶在工作流程的早期手動生成內容,則您的應用程序可能只會設置此字段。大多數應用程序不應該設置此項。

您需要改用以下內容:

Facebook.request("me/feed", bundle, "POST"); 
+0

我改變什麼ü說,但我不上牆 – NagarjunaReddy

+0

得到任何東西你怎麼在logcat中收到? –

+0

沒有錯誤在FaceBook牆上沒有信息 – NagarjunaReddy

0
public void showPostDailog (String message) { 
     ProgressDialog authDialog = ProgressDialog.show (SubmitComplaintActivity.this , "Please wait" , 
       "Posting Message" , true , // indeterminate 
       false) ; 

     Bundle parameters = new Bundle () ; 

     parameters.putString ("link" , reult_complaint_url) ; 
     try { 
      String response = mFacebook.request ("me/feed" , parameters , "POST") ; 
      System.out.println (response) ; 
      isCompleteFacbook = true ; 
     } catch (IOException e) { 
      e.printStackTrace () ; 
     } 
     if (authDialog != null && authDialog.isShowing ()) { 
      authDialog.dismiss () ; 
      authDialog.hide () ; 
     } 
    } 
0

如果您使用的是Android的Facebook SDK,那麼代碼就在於FacebookConnector.java類。 postmessageinThread()函數。

if ((fbconnector.getFacebook().isSessionValid()) { 
    loginid=FacebookConnector.response; 
    System.out.println("FB login ID is"+loginid); 
    postMessageInThread(); //Replace this with another activity 
    //String url="https://graph.facebook.com/me/friends?access_token=TOKEN"; 
} else { 
SessionEvents.AuthListener listener = new SessionEvents.AuthListener() { 
    public void onAuthSucceed() 
    { 
     System.out.println("onAuthSucceed"); 
     postMessageInThread(); 
    } 
    public void onAuthFail(String error) 
    { 
    } 
}; 
SessionEvents.addAuthListener(listener);   System.out.println("Login to Facebook"); 
     fbconnector.login(); 

    } 
} 
private String getFacebookMsg() { 
    System.out.println("Login value from getFacenookMSg"+loginid);  
    return "test"; 
} 
相關問題