【发布时间】:2021-07-15 21:17:32
【问题描述】:
我必须改进现有的 Ionic 应用程序,使用 firebase 作为用户登录的身份验证方法。
出于我的目的,我无法在生产 firebase 应用程序中触摸现有的先前注册用户列表,我必须使用 firebase 模拟器在本地创建新列表。
添加并设置本地身份验证和数据库模拟器扩展后,我已将其添加到app.module.ts:
if (window.location.hostname === 'localhost') {
firebase.auth().useEmulator('http://localhost:9099');
}
在继续添加新的 UI 和逻辑功能,使用网络浏览器测试我的工作后,我切换到 Android 平台。运行应用并执行后
firebase.auth().signInWithEmailAndPassword(email, password);
我收到以下错误:
{
"code": "auth/network-request-failed",
"message": "A network error (such as timeout, interrupted connection, or unreachable host) has occurred."
}
它在浏览器中运行良好,但在真实设备上却不行。
【问题讨论】:
标签: android angular ionic-framework firebase-authentication firebase-tools