0

我正在开发一个对我来说很好用的 facebook 登录注销示例。我的问题是当我将提要发布到 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}
4

1 回答 1

0

只是请求权限。

String[] permissions = { "offline_access", "publish_stream", "user_photos", "publish_checkins","photo_upload" };
mFacebook.authorize(MainActivity.this, permissions,
            new LoginDialogListener());
于 2013-08-29T10:07:19.107 回答