1
我打算爲我的webapp使用Firebase的提供者身份驗證,但似乎它在移動設備上無法使用。該網站是住在這裏:Firebase Web身份驗證在移動設備上無法使用?
然後它應該去谷歌提供商身份驗證流程。
我代碼,它看起來像這樣:
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);
})
})
的問題是,雖然這個工程在桌面上偉大它根本不會在移動設備上運行。我嘗試了「signInWithRedirect」和「signInWithPopup」,但是當我在我的華爲榮譽手機上調用這些方法時,沒有任何事情發生(在任何瀏覽器中)。
我在這裏做錯了什麼或做了什麼Firebase Web身份驗證只是不適用於移動?
你救了我很多痛苦小時。謝謝! – oortCloud
哈哈,這裏一樣:) –