This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { | |
StyleSheet, | |
View, | |
Text, | |
TextInput, | |
SafeAreaView, | |
TouchableOpacity, | |
KeyboardAvoidingView, | |
ActivityIndicator, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { | |
StyleSheet, | |
View, | |
Text, | |
TextInput, | |
SafeAreaView, | |
TouchableOpacity, | |
KeyboardAvoidingView, | |
ActivityIndicator, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createAppContainer, createSwitchNavigator } from 'react-navigation'; | |
import firebase from 'firebase'; | |
import { firebaseConfig } from './config/firebase.js'; | |
import AuthNavigator from './navigation/AuthNavigator'; | |
import HomeScreen from './screens/HomeScreen.js'; | |
import * as Segment from 'expo-analytics-segment'; | |
firebase.initializeApp(firebaseConfig); | |
Segment.initialize({ androidWriteKey:"aWa3QRFL2QD3VL2oE2yAfvutRE2mBUGm", iosWriteKey:"aWa3QRFL2QD3VL2oE2yAfvutRE2mBUGm" }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { View, StyleSheet, ActivityIndicator } from 'react-native'; | |
import firebase from 'firebase'; | |
class LoadingScreen extends React.Component { | |
componentDidMount() { | |
firebase.auth().onAuthStateChanged(user => { | |
if (user) { | |
this.props.navigation.navigate('App'); | |
} else { | |
this.props.navigation.navigate('SignUp'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { StyleSheet, Text, View, SafeAreaView, Button } from 'react-native'; | |
import firebase from 'firebase'; | |
class HomeScreen extends React.Component { | |
state = { user: {} }; | |
componentDidMount() { | |
firebase.auth().onAuthStateChanged((user) => { | |
if (user != null) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { | |
StyleSheet, | |
View, | |
Text, | |
TextInput, | |
SafeAreaView, | |
TouchableOpacity, | |
KeyboardAvoidingView, | |
ActivityIndicator, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
signInWithGoogleAsync = async () => { | |
try { | |
const result = await Google.logInAsync({ | |
androidClientId: ANDRIOID_CLIENT_ID, | |
iosClientId: IOS_CLIENT_ID, | |
behavior: 'web', | |
iosClientId: '', //enter ios client id | |
scopes: ['profile', 'email'] | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async signInWithGoogle() { | |
try { | |
const result = await Expo.Google.logInAsync({ | |
androidClientId: ANDROID_CLIENT_ID, | |
iosClientId: IOS_CLIENT_ID, | |
behavior: 'web', | |
iosClientId: '', //enter ios client id | |
scopes: ['profile', 'email'] | |
}); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const firebaseConfig = { | |
apiKey: "WRITE YOUR API KEY", | |
authDomain: "WRITE YOUR AUTH DOMAIN", | |
databaseURL: "WRITE YOUR DATABASE URL", | |
projectId: "WRITE YOUR PROJ ID", | |
storageBucket: "WRITE YOUR STORAGE BUCKET", | |
messagingSenderId: "WRITE YOUR MESSAGING SENDER ID", | |
appId: "WRITE YOUR APP ID", | |
measurementId: "WRITE YOUR MEASUREMENT ID" | |
}; |
OlderNewer