Firebase Web Auth在移动设备上不起作用?

Jim*_*Jim 6 javascript google-authentication firebase typescript firebase-authentication

我计划对我的webapp使用Firebase的提供程序身份验证,但它似乎无法在移动设备上运行.该网站在这里:

https://cypher.city

然后当您单击此按钮时: 在此输入图像描述

将出现一个弹出窗口.当您单击此按钮时: 在此输入图像描述

然后它应该去谷歌提供商认证流程.

我的代码看起来像这样:

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);

    })

  })
Run Code Online (Sandbox Code Playgroud)

问题是,虽然这在桌面上运行良好,但它在移动设备上根本不起作用.我已经尝试了"signInWithRedirect"和"signInWithPopup",但是当我在我的华为Honor手机上调用这些方法时,没有任何事情发生(在任何浏览器中).

我在这里做错了什么,或者Firebase网络身份验证是否无法在移动设备上运行?

Jim*_*Jim 18

这有点令人尴尬,但它可能会帮助别人.真正的问题是没有与移动设备有任何关系,但实际上我使用的是自定义域,并且忘记在控制台的auth部分添加它.当我使用chrome dev工具打开测试生产应用程序时,我可以在控制台中看到此错误: 在此输入图像描述

在firebase控制台的这一部分添加我的自定义域工作: 在此输入图像描述

  • 你救了我很多痛苦的时光.谢谢! (7认同)