在成功的Facebook Android SDK评论帖上通过OAuthException接收500错误代码

时间:2014-01-04 21:51:26

标签: android facebook facebook-android-sdk facebook-comments android-facebook

使用Facebook的Android SDK(v3.6.0)并将登录权限设置为publish_actions,我正在进行以下简单的调用,以便向用户的Feed帖子发布评论:

String userPostID = postIDParam;
String comment = commentParam;
Session session = Session.getActiveSession();
if (session.isOpened()) {

    Bundle bundle = new Bundle();
    bundle.putString("message", comment);
    Request request = new com.facebook.Request(session, userPostID + "/comments", bundle, HttpMethod.POST, new Request.Callback() {
        @Override
        public void onCompleted(Response response) {
            if (response != null) {
                if (response.getError() == null) {
                    //parse response data
                }
                else {
                    //handle error
                }
            }
        }
    });

    request.executeAsync();
}

该帖子立即成功通过,显示为对指定帖子的评论。然而,奇怪的是,我在代码中收到了500响应代码和OAuthException错误消息"An unexpected error has occurred. Please retry your request later"。因此,我无法在我的应用中正确处理成功的帖子。

0 个答案:

没有答案