问题
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