2011-11-17 144 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"; 
}