我正在使用 Ionic Framework 和 Firebase 开发 iOS 应用程序。我已在我的项目中将 Firebase SDK 更新到版本 3.x。我想做的是在真实设备上使用 Facebook 对用户进行身份验证。当我在浏览器上测试时一切正常。然而,每当我在真实的 iOS 设备上运行时,我总是会收到以下错误:
该域无权对您的 Firebase 项目进行 OAuth 操作。从 Firebase 控制台编辑授权域列表。
在 Firebase 上,我已将“localhost”和“127.0.0.1”添加到我的授权域列表中。所以我不知道现在该怎么办。
供您参考,我在我的项目中没有使用 WKWebView。
这里有人可以告诉我如何解决这个问题吗?请指教。
错误"This domain is not authorized for OAuth operations for your Firebase project. Edit the list of authorized domains from the Firebase console."
只能防止signInWithPopup()
signInWithRedirect()
linkWithPopup()
and linkWithRedirect()
工作中的操作。所有其他功能,包括signInWithCredential()
, 应该管用。
我相信您看到此错误是因为 ionic 应用程序没有真正的域,而这是我上面提到的 4 个功能的要求。
问题的解决方案是忽略错误(它只是信息性的)并且不使用signInWithPopup
signInWithRedirect
linkWithPopup
or linkWithRedirect
。相反,使用 OAuth 库,例如ngCordovaOAuth https://github.com/nraboy/ng-cordova-oauth然后使用auth().signInWithCredential(...)
(请参阅 Twitter 的示例说明here https://firebase.google.com/docs/auth/web/twitter-login#handle_the_sign-in_flow_manually).
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)