为什么 android g+ revokeAccessAndDisconnect 仍然保留我的 g+ 权限

why android g+ revokeAccessAndDisconnect still keep my g+ permission

我正在为我的 app.I 使用 G+ 登录,用户可以选择断开 g+ 帐户。

 case R.id.action_disconnect:
            disconnectDialog = new ProgressDialog(this);
            disconnectDialog.setMessage(getResources().getString(R.string.disconnect_dialog));
            disconnectDialog.show();
            googleApiClient = buildGoogleApiClient();
            googleApiClient.connect();

    private GoogleApiClient buildGoogleApiClient() {
    return new GoogleApiClient.Builder(this)
            .addConnectionCallbacks(this)
            .addOnConnectionFailedListener(this)
            .addApi(Plus.API, Plus.PlusOptions.builder().build())
            .addScope(new Scope("email"))
            .build();
}

public void onConnected(Bundle bundle) {
    Plus.AccountApi.clearDefaultAccount(googleApiClient);
    Plus.AccountApi.revokeAccessAndDisconnect(googleApiClient).setResultCallback(new ResultCallback<Status>() {

        @Override
        public void onResult(Status status) {
            googleApiClient.disconnect();
            if (disconnectDialog != null)
                disconnectDialog.dismiss();
            accManager.Log();;
        }

    });
}

accManager.log return 应用到登录屏幕。

Plus.AccountApi.clearDefaultAccount(googleApiClient);清除用户帐户,我在单击 g+ 登录时需要再次 select 帐户进行验证。

Plus.AccountApi.revokeAccessAndDisconnect(googleApiClient) 不会撤销我的应用程序权限,因为当我单击 g+ 使用相同帐户登录时只要求我使用 select 帐户但不询问请求许可。

当我以新帐户应用程序登录时,请求我的 g+ 权限

也在卸载 reinstall 我的应用程序仍然保留我的 g+ 权限。 有没有人遇到这个问题?任何帮助将不胜感激。我关注了https://developers.google.com/+/mobile/android/sign-in

我找到了答案

buildGoogleApiClient 应该是

    private GoogleApiClient buildGoogleApiClient() {
        return new GoogleApiClient.Builder(this)
                .addConnectionCallbacks(this)
                .addOnConnectionFailedListener(this)
                .addApi(Plus.API, Plus.PlusOptions.builder().build())
                .addScope(Plus.SCOPE_PLUS_LOGIN)
                .addScope(new Scope("email"))
                .build();
    }