How do you force AccountManager to show the “Access Request” screen after a user has already allowed access?

前端 未结 4 1468
一生所求
一生所求 2020-12-03 05:52

When using AccountManager::getAuthTokenByFeatures, an Access Request screen is shown for the user to allow or deny access to the account. After a user allows access, subsequ

4条回答
  •  爱一瞬间的悲伤
    2020-12-03 06:14

    In my case what Benn Sandoval says does not work.

    I had to revoke permissions programmatically and then connect again.

    if (googleApiClient != null && !googleApiClient.isConnecting() && googleApiClient.isConnected()){
    
        googleApiClient.clearDefaultAccountAndReconnect();
        Plus.AccountApi.revokeAccessAndDisconnect(googleApiClient).setResultCallback(new ResultCallback() {
            @Override
            public void onResult(Status status) {
                Log.i("google+", "Google+ user access revoked");
                googleApiClient.connect();
            }
        });
    }
    

    Doing this i was getting asked again to grant permissions to google+

提交回复
热议问题