react-native                
            Integration med Firebase för verifiering
        
        
            
    Sök…
Introduktion
// Byt ut värden för brandbas med dina app-api-värden importera eldbas från 'eldstad';
componentWillMount () {firebase.initializeApp ({apiKey: "dinAPIKey", authenticDomain: "authDomainNAme", databasURL: "yourDomainBaseURL", projectId: "yourProjectID", storageBucket: "storageBUcketValue", messagingSenderId: "}) firebase.auth (). signInWithEmailAndPassword (e-post, lösenord) .then (this.onLoginSuccess)})}
React Native - ListView with Firebase
Det här är vad jag gör när jag arbetar med Firebase och jag vill använda ListView.
Använd en överordnad komponent för att hämta data från Firebase (Posts.js):
Posts.js
import PostsList from './PostsList';
class Posts extends Component{
    constructor(props) {
        super(props);
        this.state = {
            posts: []
        }
    }
    
    componentWillMount() {
        firebase.database().ref('Posts/').on('value', function(data) {
            this.setState({ posts: data.val() });
        });
    }
    render() {
        return <PostsList posts={this.state.posts}/>
    }
}
 PostsList.js
class PostsList extends Component {
    constructor(props) {
        super(props);
        this.state = {
            dataSource: new ListView.DataSource({
                rowHasChanged: (row1, row2) => row1 !== row2
            }),
        }
    }
    getDataSource(posts: Array<any>): ListView.DataSource {
        if(!posts) return;
        return this.state.dataSource.cloneWithRows(posts);
    }
    componentDidMount() {
        this.setState({dataSource: this.getDataSource(this.props.posts)});
    }
    componentWillReceiveProps(props) {
        this.setState({dataSource: this.getDataSource(props.posts)});
    }
    renderRow = (post) => {
        return (
            <View>
                <Text>{post.title}</Text>
                <Text>{post.content}</Text>
            </View>
        );
    }
    render() {
        return(
            <ListView
                dataSource={this.state.dataSource}
                renderRow={this.renderRow}
                enableEmptySections={true}
            />
        );
    }
}
  Jag vill påpeka att i Posts.js jag inte firebase eftersom du bara behöver importera den en gång, i huvudkomponenten i ditt projekt (där du har navigatören) och använder det var som helst. 
Detta är lösningen som någon föreslog i en fråga jag ställde när jag kämpade med ListView. Jag tänkte att det skulle vara trevligt att dela det.
Autentisering i reaktion Native med hjälp av eldstad
Byt ut värden för brandbas med api-värdena för appen:
import firebase from 'firebase';
componentWillMount() {
firebase.initializeApp({
  apiKey: "yourAPIKey",
  authDomain: "authDomainNAme",
  databaseURL: "yourDomainBaseURL",
  projectId: "yourProjectID",
  storageBucket: "storageBUcketValue",
  messagingSenderId: "senderIdValue"
});
    firebase.auth().signInWithEmailAndPassword(email, password)
  .then(this.onLoginSuccess)
  .catch(() => {
    firebase.auth().createUserWithEmailAndPassword(email, password)
      .then(this.onLoginSuccess)
      .catch(this.onLoginFail)
  })
}