Facebook Post喜欢的行动不适用于Android

时间:2015-01-29 11:30:18

标签: android facebook-sdk-3.0

我正在使用facebook sdk在Android应用中登录。我的代码在Android应用程序中登录facebook工作正常。但后来我使用Facebook喜欢动作使用Facebook sdk错误发生。错误低于

{Response:  responseCode: 403, graphObject: null, error: {HttpStatus: 403, errorCode: 200, errorType: OAuthException, errorMessage: (#200) You do not have sufficient permissions to perform this action}, isFromCache:false}}, isFromCache:false}

代码是: -

String grapPath = String.format("%s/likes", postID);
        Request request = new Request(Session.getActiveSession(), grapPath,
                null, HttpMethod.POST, new Request.Callback() {
                    @Override
                    public void onCompleted(Response response) {
                        String res = response.toString();
                        Log.i("********************************", res
                                + " Success!");
                    }
                });
        Request.executeBatchAsync(request);

请帮我解决这个问题。

1 个答案:

答案 0 :(得分:1)

错误很明显,你没有发布所需的权限, 在记录用户时,要求获得相关许可" publish_actions"

了解更多信息 - > https://developers.facebook.com/docs/facebook-login/permissions