-
Notifications
You must be signed in to change notification settings - Fork 2
/
App.js
38 lines (33 loc) · 911 Bytes
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import Router from './src/Router';
import * as firebase from 'firebase';
export default class App extends React.Component {
constructor(props){
super(props)
this.state = { loggedIn: null}
}
componentWillMount() {
firebase.initializeApp({
apiKey: "AIzaSyC_WAOptgcEK5KkfMJMo85kiwciz2cVVew",
authDomain: "zutsme.firebaseapp.com",
databaseURL: "https://zutsme.firebaseio.com",
projectId: "zutsme",
storageBucket: "zutsme.appspot.com",
messagingSenderId: "737052347201"
});
// method for handling either signing in or out
firebase.auth().onAuthStateChanged( (user) => {
if (user) {
this.setState({ loggedIn: true});
}else {
this.setState({ loggedIn: false });
}
})
}
render() {
return (
<Router />
);
}
}