my FirebaseConfig.js
import firebase from “firebase/app”
import “firebase/auth”;
import “firebase/database”;
import ‘firebase/firestore’;

const firebaseConfig = {
apiKey: ‘AIzaSyD3x41FYcVOfyzfrb93gODDTHSgNa0Yq40’,
authDomain: ‘whiterose-6b31f.firebaseapp.com’,
projectId: ‘whiterose-6b31f’,
databaseURL: ‘https://whiterose-6b31f-default-rtdb.europe-west1.firebasedatabase.app/’,
storageBucket: “whiterose-6b31f.appspot.com”,
messagingSenderId: ‘6427461933’,
appId: ‘1:6427461933:ios:012616b0414b2ac36c6ba4’,
};
if (!firebase.apps.length) {
firebase.initializeApp(firebaseConfig);
}

export { firebase };

google-services.json
{
“project_info”: {
“project_number”: “640952084004”,
“project_id”: “white-rose-27cf0”,
“storage_bucket”: “white-rose-27cf0.appspot.com”
},
“client”: [
{
“client_info”: {
“mobilesdk_app_id”: “1:640952084004:android:da40b1fcce2addacee5ab1”,
“android_client_info”: {
“package_name”: “white.rose”
}
},
“oauth_client”: [
{
“client_id”: “640952084004-u4neobkpfmmnag69jp9a4s2120qice5v.apps.googleusercontent.com”,
“client_type”: 3
}
],
“api_key”: [
{
“current_key”: “AIzaSyBX-fPula3jANgTAbZ3qN475uZIbzArzYs”
}
],
“services”: {
“appinvite_service”: {
“other_platform_oauth_client”: [
{
“client_id”: “640952084004-u4neobkpfmmnag69jp9a4s2120qice5v.apps.googleusercontent.com”,
“client_type”: 3
}
]
}
}
}
],
“configuration_version”: “1”
}

import firebase from ‘firebase/app’;
import { Navigation } from ‘./app/Navigation’;
import * as Font from ‘expo-font’;
import { useState } from ‘react’;
import AppLoading from ‘expo-app-loading’;
import ‘@react-native-firebase/auth’;
import ‘@react-native-firebase/database’;
import { firebaseConfig } from ‘./app/DB/FirebaseConfig’;
import { SafeAreaView } from ‘react-native’;

firebase.initializeApp(firebaseConfig);

const fonts = ()=> Font.loadAsync({
‘multi’:require(‘./app/assets/fonts/MultiroundPro.otf’),
‘yu-reg’:require(‘./app/assets/fonts/YuGothicUIRegular.ttf’),
‘yu-semibold’:require(‘./app/assets/fonts/YuGothicUISemibold.ttf’)
});

export default function App() {
const [font, setFont]=useState(false);
if(font){
return (
<SafeAreaView style={{ flex: 1 }}>
<Navigation/>
</SafeAreaView>
);
}else{
return(
<AppLoading startAsync={fonts} onFinish={()=>setFont(true)} onError={console.warn}/>
)
}

};

import { Text, View, Pressable, TextInput, Alert, ScrollView} from ‘react-native’;
import Header from ‘…/components/Header’;
import Footer from ‘…/components/Footer’;
import { gStyle } from ‘…/styles/style’;
import React, {useState} from ‘react’;
import auth from ‘@react-native-firebase/auth’;
import database from ‘@react-native-firebase/database’;


export default function Registration() {
const [name, setName] = useState(‘’);
const [surname, setSurname]=useState(‘’);
const [email, setEmail] = useState(‘’);
const [phone, setPhone] = useState(‘’);
const [password, setPassword] = useState(‘’);
const [confirmPassword, setConfirmPassword]=useState(‘’);
const handleRegistration=()=>{
if(
name===‘’||
surname===‘’||
email===‘’||
phone===‘’||
password===‘’||
confirmPassword===‘’
){
Alert.alert(‘Ошибка!’,‘Пожалуйста, заполните все поля для регистрации’);
}
if(password!==confirmPassword){
Alert.alert(‘Ошибка!’,‘Пароли не совпадают’);
return;
}
auth()
.createUserWithEmailAndPassword(email, password)
.then((result)=>{
const userDetails={
name,
surname,
email,
phone,
};
database().ref(users/${result.user.uid}).set(userDetails);
})
.catch((error)=>{
Alert.alert(error.message);
})
}
return (
<View>
<ScrollView>
<Header/>
<View style={gStyle.main}>
<Text style={gStyle.header}>Зарегистрироваться</Text>
<Text style={gStyle.RegLine}></Text>
<View style={gStyle.RegContainer}>
<View style={gStyle.RegBox}>
<Text style={gStyle.RegName}>Имя</Text>
<TextInput style={gStyle.RegInfo}
onChangeText={text => setName(text)}/>
</View>
<View style={gStyle.RegBox}>
<Text style={gStyle.RegName}>Фамилия</Text>
<TextInput style={gStyle.RegInfo}
onChangeText={text => setSurname(text)}/>
</View>
<View style={gStyle.RegBox}>
<Text style={gStyle.RegName}>Электронная почта</Text>
<TextInput style={gStyle.RegInfo}
onChangeText={text => setEmail(text)}/>
</View>
<View style={gStyle.RegBox}>
<Text style={gStyle.RegName}>Номер телефона</Text>
<TextInput style={gStyle.RegInfo}
onChangeText={text => setPhone(text)}/>
</View>
<View style={gStyle.RegBox}>
<Text style={gStyle.RegName}>Пароль</Text>
<TextInput style={gStyle.RegInfo}
onChangeText={text => setPassword(text)}
secureTextEntry={true}/>
</View>
<View style={gStyle.RegBox}>
<Text style={gStyle.RegName}>Подтверждение пароля</Text>
<TextInput style={gStyle.RegInfo}
onChangeText={text => setConfirmPassword(text)}
secureTextEntry={true}/>
</View>
</View>
<Pressable style={gStyle.RegRegistrBtn} onPress={handleRegistration}>
<Text style={gStyle.RegRegistration}>Зарегистрироваться</Text>
</Pressable>
<Text style={gStyle.RegConf}>Нажимая на кнопку, Вы соглашаетесь с{‘\n’}Политикой конфиденциальности</Text>
<Text style={gStyle.RegLine}></Text>
</View>
<Footer/>
</ScrollView>
</View>
);
}