1

私は自分の反応ネイティブアプリケーションにfirebaseを使用しています。私はfirebase認証を使用してサインインしようとしたときに何が起こるのか分かりません。しかし、昨日、私のアプリケーションでは起こりません。なぜそれが起こったのかわかりません。私は今私が立ち往生しているのを助けてください。Firebaseがサポートしていないブラウザ

エラー画像は、これは私のソースコード

import React, { Component } from 'react'; 
import { 
    Text, 
    View, 
    TouchableOpacity, 
    TextInput, 
    Image, 
    Button, 
    AsyncStorage 
} from 'react-native'; 
import FBSDK, { LoginButton, AccessToken } from 'react-native-fbsdk'; 
import { GoogleSignin, GoogleSigninButton } from 'react-native-google-signin'; 
import styles from '../components/style.js'; 
import firebase from '../components/Firebase.js'; 



export default class Signin extends Component { 
    constructor(){ 
     super(); 
      this.state={ 
       email:'', 
       password: '' 
     } 
    } 

    componentWillMount() { 
    GoogleSignin.hasPlayServices({ autoResolve: true }).then(() => { 
    GoogleSignin.configure ({ 
     webClientId: '678031332619-ol6s25inanfpk0fkudjt5dhdhfd1m9ov.apps.googleusercontent.com' 
     }) 
    }) 
    .catch((err) => { 
    console.log("Play services error", err.code, err.message); 
     }) 
    } 

    signIn(){ 
     firebase.auth().signInWithEmailAndPassword(this.state.email, this.state.password).then((userData) => { 
      AsyncStorage.setItem('userData', JSON.stringify(userData)) 
      alert("Sign in Success") 
      this.props.navigation.navigate('Form'); 
     }).catch((e) => { 
      alert(e) 
     }) 
    } 

    handleSigninGoogle() { 
    GoogleSignin.signIn().then((user) => { 
     console.log(user); 
     }).catch((error) => { 
     console.log('WRONG SIGNIN', error); 
     }).done(); 
    } 

    Signout() { 
    GoogleSignin.signOut() 
    .then(() => { 
     console.log('out'); 
    }) 
    .catch((err) => { 

    }); 
    } 
    render() { 
     console.ignoredYellowBox = ['Remote debugger']; 
     const { navigate } = this.props.navigation; 
    return (
    <View style={styles.container}> 
     <Text style={styles.title}> 41 Studio IT Solutions </Text> 

      <TextInput 
      style={styles.loginInput} 
      onChangeText={(email) => this.setState({email})} 
      value={this.state.email} 
      underlineColorAndroid='transparent' 
      placeholder='Email' 
      /> 

      <TextInput 
      style={styles.loginInput} 
      onChangeText={(password) => this.setState({password})} 
      value={this.state.password} 
      underlineColorAndroid='transparent' 
      placeholder='Password' 
      secureTextEntry 
      /> 
      <View style={styles.main}> 
      <TouchableOpacity 
       style={styles.button} 
       onPress={this.signIn.bind(this)} 
      > 
      <Text style={styles.buttonText}> Sign In </Text> 
      </TouchableOpacity> 

      <TouchableOpacity 
       style={styles.button} 
       onPress={() => navigate('Register')} 
      > 
      <Text style={styles.buttonText}> Register </Text> 
      </TouchableOpacity> 

      </View> 
      <LoginButton 
      style={styles.facebookButton} 
      publishPremissions={["publish_actions"]} 
      onLoginFinished= {(error, result) => { 
       if(error) { 
        alert(error); 
       } 
       else if (result.isCancelled){ 
        console.log('Cancelled') 
       } 
       else { 
        AccessToken.getCurrentAccessToken().then((data) => { 
         console.log(data.accessToken.toString()) 
         const credential = firebase.auth.FacebookAuthProvider.credential(data.accessToken.toString()); 
         firebase.auth().signInWithCredential(credential).catch((e) => console.log(e)) 
         }) 
        } 
       } 
      } 
      onLogoutFinished={() => console.log("logout")} 
      /> 
      <GoogleSigninButton 
      style={styles.googleButton} 
      size={GoogleSigninButton.Size.Wide} 
      color={GoogleSigninButton.Color.Light} 
      onPress={this.handleSigninGoogle.bind(this)}/> 
      <Button onPress={() => this.Signout.bind(this)} title="Signout" /> 
     </View> 
    ); 
    } 
} 

答えて

0

UPDATEある

https://i.stack.imgur.com/SieCM.jpg

下のリンクを次のとおりです。[email protected]がこれはこの問題

を解決しました[email protected]

を使用していることを前提としています。新しいバージョンがリリースされるまで

https://github.com/firebase/firebase-js-sdk/issues/223

は、クイックフィックスは4.5.0

+0

私がしようとしますが、どのように私のfirebaseをダウングレードするにダウングレードするのですか? –

+0

'糸のアップグレードファイアベース@ 4.5.0'または' npmのインストールfirebase @ 4.5.0' –

+0

ありがとうございました! –

関連する問題