【问题标题】:This operation is not supported in the environment…be http or https and web storage must be enabled环境不支持此操作…http 或 https 且必须启用 web 存储
【发布时间】:2017-06-13 06:45:11
【问题描述】:

我正在使用firebaseangularjsionic 框架中开发一个混合移动应用程序。当我尝试在浏览器中使用signInWithPopup('twitter') 使用twitter 登录时,它可以正常工作,它为我提供了来自 twitter 的正确用户数据,但在我的 android 设备中,我收到如下错误

代码:auth/operation-not-supported-in-this-environment。信息 : “此应用程序的环境不支持此操作 正在运行。 “location.protocol”必须是 http 或 https 和 web 必须启用存储。”

我不知道如何解决这个问题..

提前致谢

【问题讨论】:

标签: angularjs firebase twitter ionic-framework firebase-authentication


【解决方案1】:

Ionic/Cordova 不支持signInWithPopup。您需要使用signInWithRedirect。关于如何支持 Cordova/Ionic 应用的 OAuth 登录,请参考官方文档:https://firebase.google.com/docs/auth/web/cordova

【讨论】:

    【解决方案2】:

    signINWithPopup 仅在浏览器中有效,在 ionic 中无效。 Fire-base 在 3.9.0 的 fire-base 版本中解决了这个问题,请点击以下链接,我的应用程序可以在 Facebook、google 和 twitter 上正常运行。

    https://firebase.google.com/docs/auth/web/cordova

    【讨论】:

    • 如果您无法做到这一点,请在此处发送您的请求
    猜你喜欢
    • 2016-11-21
    • 2016-01-19
    • 2016-12-01
    • 2016-12-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-12-21
    相关资源
    最近更新 更多