This operation is not supported in the environment this application is running on. “location.protocol” must be http or https

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-14 11:36:24

问题


Using Firebase and React Native to authenticate users into my app.

One thing I have noticed is when trying to use facebook login however I am thrown this error:

This operation is not supported in the environment this application is running on. "location.protocol" must be http or https.

Not really sure how to solve it honestly


回答1:


You must be using signInWithPopup/Redirect. This is only currently supported in a browser environment. You will need to use some native library (facebook/google) to retrieve the corresponding OAuth access token. Once you get that, you can call signInWithCredential to sign in the Firebase user:

firebase.auth().signInWithCredential(firebase.auth.FacebookAuthProvider.credential(fbAccessToken))


来源:https://stackoverflow.com/questions/38448800/this-operation-is-not-supported-in-the-environment-this-application-is-running-o

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!