2013-02-12 160 views
0

我正在使用下面的代碼發佈消息在Facebook的朋友牆上通過我的android應用程序。它是工作之前2013年6月feb2013.but從2013年7月二日它給我一個錯誤,得到迴應:如何發佈消息在facebook上的朋友牆在android

{"error":{"message":"(#200) Feed story publishing to other users is disabled for this application","type":"OAuthException","code":200}}

我的代碼,

public void postToWall(String message){ 
    Bundle parameters = new Bundle(); 
    parameters.putString("message", message); 
    parameters.putString("description", "topic share"); 
    try { 
     facebook.request("me"); 
     //    String response = facebook.request("Mrunal.Junghare/feed", parameters, "POST"); 
     String response = facebook.request(""+frienduser_id+""+"/feed", parameters, "POST"); 
     //   System.out.println("name111111========"+""+ListActivity.user_name+"/feed"); 
     Log.d("Tests", "got response: " + response); 
     if (response == null || response.equals("") || 
       response.equals("false")) { 
      Toast.makeText(getApplicationContext(), "Blank response.", Toast.LENGTH_SHORT).show(); 
     } 
     else { 

      Toast.makeText(getApplicationContext(),"Message posted to facebook wall!",Toast.LENGTH_SHORT).show(); 
     } 
     finish(); 
    } catch (Exception e) { 

     Toast.makeText(getApplicationContext(),"Failed to post to wall!", Toast.LENGTH_SHORT).show(); 
     e.printStackTrace(); 
     finish(); 
    } 
} 

如何解決2013年2月重大更改的問題..

+0

http://stackoverflow.com/questions/4883063/how-to-post-message-on-facebook-wall-using-facebook -Android-SDK集成的-androi?RQ = 1 – 2013-02-12 13:45:29

回答

0

嘗試此,

private void postToFacebook(String review) { 
    mProgress.setMessage("Posting ..."); 
    mProgress.show(); 

    AsyncFacebookRunner mAsyncFbRunner = new AsyncFacebookRunner(mFacebook); 

    Bundle params = new Bundle(); 

    params.putString("message", review); 
    params.putString("name", "Message"); 


    mAsyncFbRunner.request("me/feed", params, "POST", 
      new WallPostListener()); 
} 

private final class WallPostListener extends BaseRequestListener { 
    public void onComplete(final String response) { 
     mRunOnUi.post(new Runnable() { 
      @Override 
      public void run() { 
       mProgress.cancel(); 

       Toast.makeText(Mainactivity.this, "Posted to Facebook", 
         Toast.LENGTH_SHORT).show(); 
      } 
     }); 

    } 
} 

這裏具有示例代碼使用本Click here

相關問題