davideast / firebase-react-native-sample

Using React Native with Firebase
786 stars 135 forks source link

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

Closed maggialejandro closed 7 years ago

maggialejandro commented 7 years ago

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!

maggialejandro commented 7 years ago

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:

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

suhabaobaid commented 7 years ago

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

vishuhanda001 commented 7 years ago

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

rodrigoschamber commented 5 years ago

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

FMGordillo commented 3 years ago

Almost 4 years and no answer lol