import React from 'react'; import { StyleSheet, Platform, Image, Text, View, ScrollView } from 'react-native'; import firebase from 'react-native-firebase'; export default class App extends React.Component { constructor() { super(); this.state = {}; } async componentDidMount() { // TODO: You: Do firebase things // const { user } = await firebase.auth().signInAnonymously(); // console.warn('User -> ', user.toJSON()); // await firebase.analytics().logEvent('foo', { bar: '123'}); } render() { return ( Welcome to {'\n'} React Native Firebase To get started, edit App.js {Platform.OS === 'ios' ? ( Press Cmd+R to reload,{'\n'} Cmd+D or shake for dev menu ) : ( Double tap R on your keyboard to reload,{'\n'} Cmd+M or shake for dev menu )} The following Firebase modules are pre-installed: {firebase.admob.nativeModuleExists && admob()} {firebase.analytics.nativeModuleExists && analytics()} {firebase.auth.nativeModuleExists && auth()} {firebase.config.nativeModuleExists && config()} {firebase.crashlytics.nativeModuleExists && crashlytics()} {firebase.database.nativeModuleExists && database()} {firebase.firestore.nativeModuleExists && firestore()} {firebase.functions.nativeModuleExists && functions()} {firebase.iid.nativeModuleExists && iid()} {firebase.invites.nativeModuleExists && invites()} {firebase.links.nativeModuleExists && links()} {firebase.messaging.nativeModuleExists && messaging()} {firebase.notifications.nativeModuleExists && notifications()} {firebase.perf.nativeModuleExists && perf()} {firebase.storage.nativeModuleExists && storage()} ); } } const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#F5FCFF', }, logo: { height: 120, marginBottom: 16, marginTop: 64, padding: 10, width: 135, }, welcome: { fontSize: 20, textAlign: 'center', margin: 10, }, instructions: { textAlign: 'center', color: '#333333', marginBottom: 5, }, modules: { margin: 20, }, modulesHeader: { fontSize: 16, marginBottom: 8, }, module: { fontSize: 14, marginTop: 4, textAlign: 'center', } });