Angular + Firebase + Cordova google 身份验证
Angular + Firebase + Cordova google auth
我在 Angular 10 + Firebase 上有一个现成的 Web 应用程序,具有 Google 帐户授权。
但是当我用 cordova 制作 android 应用时
angularFireAuth.signInWithPopup(provider)
它没有用,失败了:
Error: This operation is not supported in the environment this application is running on. "location.protocol" must be http, https or chrome-extension and web storage must be enabled.
同angularFireAuth.signInWithRedirect(provider)
。
我应该使用什么在 angular + cordova + firebase android 应用程序中制作 google 身份验证?
我读过 https://firebase.google.com/docs/auth/web/cordova 但它没有帮助——我无法安装所有插件(出现错误),而且我读到的关于 cordova 的所有内容都没有帮助,因为我有 main Angular AuthService 中的功能,我在其中使用 AngularFireAuth.
这是我使用 cordova 和 angularfire 的第一个项目,所以我被卡住了,到处都找不到答案。
要么使用 cordova-plugin-ionic-webview 使用 http://
而不是 file://
将 Cordova 应用程序加载到 Webview 中。
或使用原生移动 Firebase SDK,例如cordova-plugin-firebasex and use authenticateUserWithGoogle()
.
我在 Angular 10 + Firebase 上有一个现成的 Web 应用程序,具有 Google 帐户授权。
但是当我用 cordova 制作 android 应用时
angularFireAuth.signInWithPopup(provider)
它没有用,失败了:
Error: This operation is not supported in the environment this application is running on. "location.protocol" must be http, https or chrome-extension and web storage must be enabled.
同angularFireAuth.signInWithRedirect(provider)
。
我应该使用什么在 angular + cordova + firebase android 应用程序中制作 google 身份验证?
我读过 https://firebase.google.com/docs/auth/web/cordova 但它没有帮助——我无法安装所有插件(出现错误),而且我读到的关于 cordova 的所有内容都没有帮助,因为我有 main Angular AuthService 中的功能,我在其中使用 AngularFireAuth.
这是我使用 cordova 和 angularfire 的第一个项目,所以我被卡住了,到处都找不到答案。
要么使用 cordova-plugin-ionic-webview 使用 http://
而不是 file://
将 Cordova 应用程序加载到 Webview 中。
或使用原生移动 Firebase SDK,例如cordova-plugin-firebasex and use authenticateUserWithGoogle()
.