davideast/firebase-react-native-sample

[Google] auth/operation-not-supported-in-this-environment

maggialejandro opened this issue · 5 comments

I'm trying to login with Google but it throws me this error:

code: "auth/operation-not-supported-in-this-environment"
message: "This operation is not supported in the environment this application is running on. "location.protocol" must be http, https or chrome-extension and web storage must be enabled."

This is the code:

const provider = new firebase.auth.GoogleAuthProvider();
provider.addScope('profile');
provider.addScope('email');
firebase.auth().signInWithPopup(provider)
  .then((result) => {
    console.log(result);
  })
  .catch((error) => {
    console.log(error);
  })

Aditional Information:

"firebase": "^3.7.1",
"react-native": "^0.42.0",
platform: Android

any ideas?
thanks in advance!

Update:
I'm using react-native-google-signin to sign in and get the idToken, then I use signInWithCredential but it throws the same error

const credential = provider.credential(token);
firebase.auth().signInWithCredential(credential)...

Google provider is enabled in Firebase console:

  • web client ID for OAuth 2.0 is the same that I used to log in with Google.
  • I get web client secret from the debug keystore that I needed to sign the APK for Google auth.

captura de pantalla de 2017-03-16 16-05-28

Did you find a fix on this? I am getting the same error

have you got any fix on this ????? please tell i am getting the same issue

Hi! Is there any conclusion about how to solve that? I am facing the same error using react native.

Almost 4 years and no answer lol