使用 Firebase 和 React Native 对进入我的应用的用户进行身份验证。
我注意到的一件事是在尝试使用 facebook 登录时出现此错误:
This operation is not supported in the environment this application is running on. "location.protocol" must be http or https.
不太确定如何诚实地解决它
最佳答案
您必须使用 signInWithPopup/Redirect。这目前仅在浏览器环境中受支持。您将需要使用一些 native 库 (facebook/google) 来检索相应的 OAuth 访问 token 。一旦你得到它,你可以调用 signInWithCredential 来登录 Firebase 用户:
firebase.auth().signInWithCredential(firebase.auth.FacebookAuthProvider.credential(fbAccessToken))
关于facebook - 此应用程序运行的环境不支持此操作。 "location.protocol"必须是 http 或 https,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38448800/