2013-08-29 106 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

相关问题