I was planning to use Firebase's provider authentication for my webapp, but it seems that it doesn't work on mobile devices. the site is live here:
Then when you click this button:
a popup will appear. And when you click this button:
then it should go to a google provider authentication flow.
My code for it looks like this:
var provider = new firebase.auth.GoogleAuthProvider();
firebase.auth().signInWithRedirect(provider).then((result) => {
// console.log('@$ signin wiht google worked!' + e +', user is: ' + firebase.auth().currentUser.uid);
console.log('@$ signin wiht google worked!' + result.user);
}).catch((e) => {
console.log('@$ signin wiht google failed!' + e);
firebase.auth().signInAnonymously().then((user) => {
console.log('@$ signed in anonymously againQ ' + user.uid);
// console.log('@$ and firebase knows it: ' + firebase.auth().currentUser.uid);
}).catch((e) => {
console.log('@$ signed in anonymously failed ' + e);
})
})
The problem is that while this works great on desktop it doesn't work at all on mobile devices. I have tried both "signInWithRedirect" and "signInWithPopup", but when I call these methods on my Huawei Honor phone nothing happens (in any browser).
Am I doing something wrong here or does Firebase web authentication just not work on mobile?