My original plan was to implement Firebase's provider authentication for my webapp, but unfortunately, it appears that the functionality is not compatible with mobile devices. The live site can be accessed at:
Upon clicking this button: https://i.sstatic.net/HLG4C.png
a popup window should appear. Subsequently, upon clicking this button: https://i.sstatic.net/IDzmg.png
it should initiate a Google provider authentication flow.
The code snippet utilized for this purpose looks like this:
var provider = new firebase.auth.GoogleAuthProvider();
firebase.auth().signInWithRedirect(provider).then((result) => {
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);
}).catch((e) => {
console.log('@$ signed in anonymously failed ' + e);
})
})
The issue arises when attempting to use this code on mobile devices. While it functions properly on desktops, it does not seem to work on mobile platforms. I have experimented with both "signInWithRedirect" and "signInWithPopup", but neither method seems to trigger any response on my Huawei Honor phone, regardless of the browser used.
Could I be implementing something incorrectly here, or is Firebase's web authentication simply incompatible with mobile devices?