1

I create react native app with firebase user auth using, here i try to redirect user to login with facebook:

login(){
  const provider = new firebase.auth.FacebookAuthProvider();

  firebase.auth().signInWithPopup(provider)
  .then(function(result){
    Alert.alert(result.user.email);
  });
}

but i'm getting this error each time: This operation is not supported in the environment this application is runnung on."location.protocol" must be http, https or chrome-extension and web storage must be enabled. I found this question on this forum it's not exactly my problem but i think it's similar. In my application i use expo, how can i configure expo server or how can i solve it ?

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Uladz Kha
  • 2,154
  • 4
  • 40
  • 61
  • Did you initialize the project with [`firebase.initializeApp({})`](https://firebase.google.com/docs/projects/learn-more#config-files-objects)? – Juan Marco Jan 29 '20 at 13:54
  • @JuanMarco yes I did. – Uladz Kha Jan 29 '20 at 14:02
  • Are you running this app on a server? Check [this answer](https://stackoverflow.com/questions/45059919/javascript-and-firebase-error-this-operation-is-not-supported-in-the-environmen) for details. – Juan Marco Jan 29 '20 at 14:33
  • @JuanMarco no, it didn't work :( – Uladz Kha Jan 29 '20 at 15:08
  • 1
    There's no way for the Firebase SDK to show a popup in a React Native app. You'll have to use one of the other sign-in mechanisms. See https://stackoverflow.com/questions/49966086/expo-auth-operation-not-supported-in-this-enviroment – Frank van Puffelen Jan 29 '20 at 15:36
  • @FrankvanPuffelen yeah, I've seen that but it have been answered year ago, thank you – Uladz Kha Jan 29 '20 at 17:39

0 Answers0