Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

Stopped working without printing any errors whatsoever #589

Closed
JerryBels opened this issue Mar 18, 2019 · 5 comments
Closed

Stopped working without printing any errors whatsoever #589

JerryBels opened this issue Mar 18, 2019 · 5 comments

Comments

@JerryBels
Copy link

It's in an Ionic 4 app. So here is the code :

    doGoogleLogin() {
      console.log(111);
      return new Promise<any>((resolve, reject) => {
        if (this.platform.is('cordova')) {
          console.log(222);
          this.googlePlus.login({
            'scopes': '',
            'webClientId': environment.google_web_client_id,
            'offline': true
          }).then((response) => {
            console.log(333, response);
            const googleCredential = firebase.auth.GoogleAuthProvider.credential(response.idToken);
            firebase.auth().signInWithCredential(googleCredential)
              .then((user) => {
                console.log(444, user);
                resolve({
                  id: user.uid,
                  originUserId: response.userId,
                  email: response.email,
                  first_name: response.givenName,
                  last_name: response.familyName,
                  image: response.imageUrl
                });
              });
          }, (err) => {
            console.log(err);
            reject(err);
          });
        }
      });
    }

Relevant package.json part:

...
    "@ionic-native/google-plus": "^5.2.0",
...
    "cordova-plugin-googleplus": "^7.0.0",
    "cordova-support-google-services": "1.2.1",
...
      "cordova-plugin-googleplus": {
        "REVERSED_CLIENT_ID": "com.googleusercontent.apps.myid",
        "WEB_APPLICATION_CLIENT_ID": "myid.apps.googleusercontent.com",
        "PLAY_SERVICES_VERSION": "11.8.0"
      },
...

So it stopped working not long ago, I'm not sure when. What I do know is, when I migrated to Ionic 4 it worked, and now it doesn't. But the thing is, it gives no error at all ! Simply prints in console:

111
222

And then simply nothing. No 333 nor errors.

@APPGEVENT
Copy link

Same here but with an Ionic 3 project. Did you figure something out?

@JerryBels
Copy link
Author

I may have a small lead, but nothing I can share yet. Will update here if I get to it (when...). If you find some clues, don't hesitate to post them.

@APPGEVENT
Copy link

Will do.

@JerryBels
Copy link
Author

Found it. I had implemented this fix : arnesson/cordova-plugin-firebase#742 (comment) and so Google Login plugin was simply not compiling correctly - thus the weirdness of what happened. Removed it, removed the plugin from the project, changed code a bit, rebuilt - working like a charm.

@JerryBels
Copy link
Author

Can be usefull if you're still stuck with this : #487

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants