[IONIC 4] google plus plugin not working


#1

Hello,

I’m updating my app to ionic 4, and trying to login with google plus, but the function googlePlus.login() doesn’t seem to work. Even in a try{}catch{}, there is no error showing up…

my code :

async signInWithGoogle() {

  console.log('afAuth.signInWithGoogle()')
  if (this.plt.is('cordova')) {
    console.log('cordova')
    try {

      const gplusUser = await this.googlePlus.login({
        'webClientId': 'MYWEBCLIENTID.apps.googleusercontent.com',
        'offline': true
      })
      console.log(gplusUser)
      return await this.afAuth.auth.signInWithCredential(firebase.auth.GoogleAuthProvider.credential(gplusUser.idToken))
  
    } catch(err) {
      console.log(err)
      return {'error' : err}
    }
  }
  else {
    return this.oauthSignIn(new firebase.auth.GoogleAuthProvider());
  }
}

this is what the console returns :

afAuth.signInWithGoogle()
cordova

I haven’t changed my app id or sha1 certificate.

my ionic info

Ionic:

   ionic (Ionic CLI)             : 4.7.1 (/usr/local/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.0.0-rc.1
   @angular-devkit/build-angular : 0.11.4
   @angular-devkit/schematics    : 7.1.4
   @angular/cli                  : 7.1.4
   @ionic/angular-toolkit        : 1.2.2

Capacitor:

   capacitor (Capacitor CLI) : 1.0.0-beta.13
   @capacitor/core           : 1.0.0-beta.13

Cordova:

   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : android 7.0.0, browser 5.0.4, ios 4.5.5
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.3.1, (and 15 other plugins)

System:

   ios-deploy : 2.0.0
   NodeJS     : v10.3.0 (/usr/local/Cellar/node/10.3.0/bin/node)
   npm        : 6.1.0
   OS         : macOS Mojave
   Xcode      : Xcode 9.4.1 Build version 9F2000

Hope you can help me


#2

can no one help me ?


#3

Hello!, found any solution for this? I have the same issue


#4

I’m wondering this too. I was just going add this (google login) to my new project, but does it still work at all as Google is shutting down GooglePlus???


#5

@Alejandr : I haven’t found any solution yet… I have posted an issue on the github page for this plugin but it has been solved very quickly without any further investigation. After days of struggle, I have finally decided to suppress the “connect with google” option from my app, and I am still looking for a way to put it back…

@jylikorpi The plugin uses another API for google login, you can read more here