Android Facebook SDK 3 - 请求新的权限但不能重新授权

时间:2015-03-03 04:18:57

标签: android facebook facebook-graph-api

我的代码有问题,我已经按照hellofacebook示例发布了照片。但是当我尝试创建新的权限“publish_action”时,代码不会回调任何东西。这是我的代码

private void performPublish(PendingAction action, boolean allowNoSession){
    Session session = Session.getActiveSession();
    if(session != null){
        Toast.makeText(getApplicationContext(),"enter session unnull",Toast.LENGTH_SHORT).show();
        pendingAction = action;
        if(hasPublishPermission()){
            Toast.makeText(getApplicationContext(),"enter haspublish",Toast.LENGTH_SHORT).show();
            handlePendingAction();
            Toast.makeText(getApplicationContext(),"Posted Success",Toast.LENGTH_SHORT).show();
            return;
        } else if(session.isOpened()) {
            Toast.makeText(getApplicationContext(),"enter session opened",Toast.LENGTH_SHORT).show();
            Session.NewPermissionsRequest newPermission = new Session.NewPermissionsRequest(Third.this,PERMISSION);
            session.requestNewPublishPermissions(newPermission);
            Toast.makeText(getApplicationContext(),"Posted Failed",Toast.LENGTH_SHORT).show();
            return;
        }

        if(allowNoSession) {
            pendingAction = action;
            handlePendingAction();
        }
    }
}

如果可以,请帮助我,因为我是facebook SDK的新手。谢谢

1 个答案:

答案 0 :(得分:0)

根据新的facebook sdk,如果您要发布任何内容,则需要提交您的应用以供审核。在Facebook批准后,您可以使用任何登录上传图片。您可以查看此链接以查看审核流程

https://developers.facebook.com/docs/apps/review/

https://github.com/sauce/guide/wiki/Facebook's-approval-process