I have followed all the steps listed here: https://firebase.google.com/docs/auth/web/cordova, verified all the information but I am still getting the error below.
code: "auth/redirect-cancelled-by-user", message: "The redirect operation has been cancelled by the user before finalizing."
Here is how I'm calling google login:
consturctor has public afAuth: AngularFireAuth. And couple relevant imports are:
import * as firebase from 'firebase/app';
import { AngularFireAuth } from 'angularfire2/auth';
// signInWithGoogle.
signInWithGoogle(): void {
this.showLoading();
if (this.platform.is('android')) {
console.log("android");
this.provider = new firebase.auth.GoogleAuthProvider();
this.afAuth.auth.signInWithRedirect(this.provider)
.then(function () {
return firebase.auth().getRedirectResult();
})
.then((result: any) => {
if (result) {
this.handleUser(result);
}
})
.catch((error: any) => {
this.hideLoading();
var errorMessage = error.message;
console.log("android login error: ", error);
});
}
if (this.platform.is('core')) {
console.log("in core");
this.provider = new firebase.auth.GoogleAuthProvider();
this.afAuth.auth.signInWithPopup(this.provider)
.then((result: any) => {
if (result) {
this.handleUser(result);
}
})
.catch((error: any) => {
this.hideLoading();
var errorMessage = error.message;
console.log("error: ", error);
});
}
}
Above is my complete method.
Below is a test project so I'll show all the settings:
<universal-links>
<host name="bhb7m.app.goo.gl" scheme="https" />
<host name="test1-2366d.firebaseapp.com" scheme="https">
<path url="/__/auth/callback" />
</host>
</universal-links>
<preference name="AndroidLaunchMode" value="singleTask" />


I guess I must be missing a step because I can't get it to work at all.
The problem was with dependencies. I updated to Cordova 8.0 and then I started to get build errors.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With