Skip to content

Commit e6d5954

Browse files
committed
changes
1 parent cdaa535 commit e6d5954

File tree

6 files changed

+540
-21
lines changed

6 files changed

+540
-21
lines changed

Diff for: android/build.gradle

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ buildscript {
2323
}
2424

2525
apply plugin: "com.facebook.react.rootproject"
26-
apply plugin: 'com.google.gms.google-services'
2726

2827
allprojects {
2928
repositories {

Diff for: app/_layout.jsx

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import SignIn from './presentation/ui/pages/(auth)/SignIn';
55
import { useState,useEffect } from 'react';
66

77
const RootLayout =() => {
8+
89

910

1011
const screenOptions = {headerShown : false}

Diff for: app/data/remote/firebase/firebase-config.jsx

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
// import { initializeApp } from "@react-native-firebase/app";
21

2+
import { initializeApp } from "firebase/app";
33

4-
// const firebaseConfig = {
5-
// apiKey: "AIzaSyBK2ALL9Wd9g5YlGUZLhL5aAE5_hSuPQK0",
6-
// authDomain: "smart-health-ae1cb.firebaseapp.com",
7-
// projectId: "smart-health-ae1cb",
8-
// storageBucket: "smart-health-ae1cb.appspot.com",
9-
// messagingSenderId: "576186942286",
10-
// appId: "1:576186942286:web:8d12a691d62917621c941f",
11-
// measurementId: "G-V31RSG4KL5"
12-
// };
4+
const firebaseConfig = {
5+
apiKey: "AIzaSyBK2ALL9Wd9g5YlGUZLhL5aAE5_hSuPQK0",
6+
authDomain: "smart-health-ae1cb.firebaseapp.com",
7+
projectId: "smart-health-ae1cb",
8+
storageBucket: "smart-health-ae1cb.appspot.com",
9+
messagingSenderId: "576186942286",
10+
appId: "1:576186942286:web:8d12a691d62917621c941f",
11+
measurementId: "G-V31RSG4KL5"
12+
};
1313

14-
// export const firebaseApp = initializeApp(firebaseConfig);
14+
export const firebaseApp = initializeApp(firebaseConfig);
1515

Diff for: app/index.jsx

+7-5
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,27 @@ import { SafeAreaView } from 'react-native-safe-area-context';
66
import Profile from './presentation/ui/pages/(tabs)/profile';
77
import SignIn from './presentation/ui/pages/(auth)/SignIn';
88
import RootLayout from './_layout';
9-
import auth from '@react-native-firebase/auth';
9+
import auth, { firebase } from '@react-native-firebase/auth';
10+
import { firebaseApp } from './data/remote/firebase/firebase-config';
11+
import { getAuth } from 'firebase/auth';
1012

1113

1214

13-
14-
export default function App() {
15+
export default function App() {
1516

1617
// Set an initializing state whilst Firebase connects
1718
const [initializing, setInitializing] = useState(true);
1819
const [user, setUser] = useState();
19-
20+
2021
// Handle user state changes
2122
function onAuthStateChanged(user) {
23+
2224
setUser(user);
2325
if (initializing) setInitializing(false);
2426
}
2527

2628
useEffect(() => {
27-
const subscriber = auth().onAuthStateChanged(onAuthStateChanged);
29+
const subscriber = getAuth(firebaseApp).onAuthStateChanged(onAuthStateChanged);
2830
return subscriber; // unsubscribe on unmount
2931
}, []);
3032

0 commit comments

Comments
 (0)