I follow the example of making Google registration and here is the method that can be called after the user logged in

/** * Revoking access from google */ private void revokeGplusAccess() { if (mGoogleApiClient.isConnected()) { Plus.AccountApi.clearDefaultAccount(mGoogleApiClient); Plus.AccountApi.revokeAccessAndDisconnect(mGoogleApiClient) .setResultCallback(new ResultCallback<Status>() { @Override public void onResult(Status arg0) { Log.e("pavan", "User access revoked!"); mGoogleApiClient.connect(); updateUI(false); } }); } } 

I can not understand what he is doing? Who can explain? If you translate what is written, then it is needed to revoke access, but how is this different from LogOut then?

    1 answer 1

    This method, unlike log out, untie the application from Google, that is - on Google’s servers there will be no information that the application has access to Google + profile.

    If you make a simple log out, the application will still be connected to Google+, the user will be able to log in and continue to use the integration of services again when necessary.

    • Why do they use it? To ban those who misbehaves? - Aleksey Timoshchenko
    • There are many situations, for example - the user no longer wants the app to have access to his account (after unbinding, he can put some fresh information in G + that the app will not see). I advise you to make the "Unlink account" button, in addition to logout. In large applications (and on websites), this option is usually available - kit
    • OK thanks! You can also give a couple of questions ... 1) So you want to say that if the user logout, then the application still has access to his account? 2) And then how can the user log in if he makes that decision again? Does he have this opportunity? - Aleksey Timoshchenko
    • one
      1) If you logout, Google still allows the application to access G +, but the application will not be able to request anything from G + until the user logs on. 2) The user can log in by selecting an account and entering a password, as usual. If the question about the reunion of the bundle app <-> G + after revokeAccess, the user will not only have to log in again, but also allow the app access to the account G + - kit again
    • one
      Imagine a club. You can log in if you are on the VIP list and give your password. If you log out and log in again, you need to give your name and password to be allowed in again. Entered - your data found out, everything is ok. And if you make revokeAccess, you will be deleted from the VIP list, and then call / do not call, they will not be allowed in anyway, but the data about you will also be erased. If necessary, you allow yourself to be added to the list again, and you are in VIP, you can login :) The main button is [выйти] . After it, you just need to login again. The button hidden in the settings - [отсоединить аккаунт] , for every fireman, if the user wants - kit