Expo: “auth/operation-not-supported-in-this-enviroment”

前端 未结 2 1329
心在旅途
心在旅途 2021-01-19 20:23

I develop a react-native (expo) mobile app and try to sign in with a google account to firebase, but I get an error:

\"auth/operation-not-supported-in

相关标签:
2条回答
  • 2021-01-19 21:09

    Firebase does not support signInWithPopup in a React Native environment.

    You can view a full list of supported environments on this page.

    You can also submit a feature request for extended Firebase support for React Native here.

    0 讨论(0)
  • 2021-01-19 21:18

    signInWithPopup is not supported in react-native. You will need to use a third party OAuth library to get the OAuth ID token or access token and then sign in with Firebase:

    const cred = firebase.auth.GoogleAuthProvider.credential(googleIdToken, googleAccessToken);
    firebase.auth().signInWithCredential(cred)
      .then((result) => {
        // User signed in.
      })
      .catch((error) => {
        // Error occurred.
      });
    
    0 讨论(0)
提交回复
热议问题