EddyVerbruggen / cordova-plugin-googleplus

:heavy_plus_sign: Cordova plugin to login with Google Sign-In on iOS and Android
567 stars 629 forks source link

ionic 1 logged in and logged out successfully, but disconnect yielded error 4 #512

Open kurtnovice opened 6 years ago

kurtnovice commented 6 years ago

Though I can login and logout successfully, the problem that I have been having is I cannot disconnect the user from my App. I tried signing in with another person's account and I ended up with my gmail app being able to open her email account.

Here is my code

window.plugins.googleplus.disconnect(
                                    function (msg) {
                                        alert('message ' + msg);
                                    }, function (error) {
                                        alert('error ' + error);
                                    }
                                );

And I have been getting "error 4"

Please help.

shriswissfed commented 6 years ago

Hi, Pls try trysilentlogin before disconnecting,this is a suggestion.

this.googlePlus.trySilentLogin({ 'scopes': '', 'webClientId': AppConfig.CONST.webClientId, 'offline': `true` }).then((data) => {

      this.googlePlus.disconnect().then((done) => {

        this.storage.remove('login_via').then(done => {
          console.log('removed google');
          this.loading.dismiss();
        })
      }).catch(err => {
      });
    }).catch(err => {
    });``