2013-08-29 169 views
0

我正在開發一個facebook登錄登出的例子,它對我來說工作正常。我的問題是當我張貼飼料到Facebook牆時,它迴應某種類型的錯誤。 我看了很多帖子,但沒有得到result.thanks ...Facebook的迴應給用戶發佈牆壁時沒有授權應用程序

protected void PublishFedd() { 
    Session s = Session.getActiveSession(); 
    String testing="My testing app"; 
    Request request = Request.newStatusUpdateRequest(s,testing, new Request.Callback() 
     { 
      @Override 
      public void onCompleted(Response response) 
      { 
       String checkTask=sharedpreference.getString("TASK_NAME", null); 
       Log.i(TAG,"ExistingTask:"+checkTask); 
       Boolean isNetworkConnected=inetDetector.isInternetConnected(); 
       if(isNetworkConnected) 
       { 
        Log.i(TAG,"ResponseError:"+response.getError()); 

       if (response.getError() == null) 
       { 
        SharedPreferences.Editor edit=sharedpreference.edit(); 
        //edit.putString("TASK_NAME", testing); 
        edit.commit(); 
        Toast.makeText(FacebookMainActivity.this, "Status updated successfully", Toast.LENGTH_SHORT).show(); 
       } 
       else 
       { 

       } 
       } 
       else 
       { 
        Toast.makeText(FacebookMainActivity.this, "Network Connection Failure", Toast.LENGTH_SHORT).show(); 
       } 
      } 
     }); 
    request.executeAsync(); 

} 

錯誤日誌是:

ResponseError:{HttpStatus: 403, errorCode: 200, errorType: OAuthException, errorMessage: (#200) The user hasn't authorized the application to perform this action} 
+0

我也面臨着同樣的問題,這個任何想法幫助我.. – NagarjunaReddy

+0

你會給許可,您的編碼部分... – Satheesh

+0

看到這個鏈接,它可以幫助你http://stackoverflow.com/questions/18781686/error-retrieving-email-and-location-from-facebook-request-in-android/18870420#18870420 – Satheesh

回答

0

只求權限。

String[] permissions = { "offline_access", "publish_stream", "user_photos", "publish_checkins","photo_upload" }; 
mFacebook.authorize(MainActivity.this, permissions, 
      new LoginDialogListener()); 
+0

這是一個已棄用的版本,請查看我的代碼 – Satheesh

相關問題