【问题标题】:Angular + Firebase + Cordova google authAngular + Firebase + Cordova 谷歌身份验证
【发布时间】:2023-03-14 15:57:01
【问题描述】:

我在 Angular 10 + Firebase 上有一个现成的 Web 应用程序,并获得了 Google 帐户授权。

但是当我用cordova制作安卓应用时

angularFireAuth.signInWithPopup(provider)

它没有用,失败了:

错误:运行此应用程序的环境不支持此操作。 “location.protocol”必须是 http、https 或 chrome-extension,并且必须启用网络存储。

angularFireAuth.signInWithRedirect(provider)相同。

我应该使用什么来在 angular + cordova + firebase android 应用中进行谷歌身份验证?

我已经阅读了https://firebase.google.com/docs/auth/web/cordova,但它没有帮助——我无法安装所有插件(出现错误),而且我读到的所有关于 cordova 的信息都没有帮助,因为我的 Angular 中有主要功能AuthService ,我正在使用 AngularFireAuth。

这是我第一个使用 cordova 和 angularfire 的项目,所以我被卡住了,在任何地方都找不到答案。

【问题讨论】:

    标签: android angular firebase cordova firebase-authentication


    【解决方案1】:

    使用cordova-plugin-ionic-webview 将Cordova 应用程序加载到Webview 中,使用http:// 而不是file://

    或使用原生移动 Firebase SDK,例如cordova-plugin-firebasex 并使用 authenticateUserWithGoogle()

    【讨论】:

      猜你喜欢
      • 2018-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-04-30
      • 1970-01-01
      • 2018-11-22
      • 2021-12-20
      • 2016-12-08
      • 1970-01-01
      相关资源
      最近更新 更多