firebase - Firebase 身份验证网络未登录
问题描述
我是flutter web的新手,我正在研究一个在android上运行良好的项目
问题是当我部署到 Firebase 托管并单击 google 登录按钮时。弹出窗口显示,我可以登录,但是当它弹出时,我的应用程序没有收到 FirebaseAuth.User 对象,即使我在浏览器的控制台中评估 firebase.auth().currentUser 表达式,它也保持为空
我的 index.html 文件:
<html>
<head>
<meta charset="UTF-8">
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
<meta name="description" content="A new Flutter project.">
<meta name="google-signin-client_id" content="<my client id>.apps.googleusercontent.com">
<!-- iOS meta tags & icons -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="ChurchData">
<link rel="apple-touch-icon" href="icons/Icon-192.png">
<!-- Favicon -->
<link rel="icon" type="image/png" href="favicon.png"/>
<title>App</title>
<link rel="manifest" href="manifest.json">
</head>
<body>
<script src="https://apis.google.com/js/platform.js"></script>
<script src="/__/firebase/7.24.0/firebase-app.js"></script>
<script src="/__/firebase/7.24.0/firebase-analytics.js"></script>
<script src="/__/firebase/7.24.0/firebase-auth.js"></script>
<script src="/__/firebase/7.24.0/firebase-firestore.js"></script>
<script src="/__/firebase/7.24.0/firebase-functions.js"></script>
<script src="/__/firebase/7.24.0/firebase-messaging.js"></script>
<script src="/__/firebase/7.24.0/firebase-storage.js"></script>
<script src="/__/firebase/7.24.0/firebase-database.js"></script>
<script src="/__/firebase/7.24.0/firebase-remote-config.js"></script>
<!-- Load the Firebase SDKs before loading this file -->
<script src="/__/firebase/init.js"></script>
<script src="main.dart.js" type="application/javascript"></script>
</body>
</html>
解决方案
推荐阅读
- swift - SwiftUI: compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions
- python - 按顺序拆分字符串每个可能的拆分
- java - Pyspark:出现错误 py4j.protocol.Py4JJavaError:调用 o6604.save 时出错。\n:java.lang.OutOfMemoryError:Java 堆空间
- html - 如何在 SSRS 中设置报告以在单个 .rdl 中以 HTML 和 PDF 输出查看
- python - 下载 yolov3 的预训练权重时出错
- javascript - 从 Redux 迁移到 Redux 工具包
- javascript - 无法在 Google Drive 插件中生成缩略图
- java - 带阈值的最大和子序列
- html - 如何在每页打印浏览器后完全打印一次背景图像?
- html - 我正在尝试从 mls 网站上抓取房地产列表,并且很幸运能喝到漂亮的汤,也许硒会更容易?