This repository was archived by the owner on Jul 22, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { initializeApp } from 'firebase/app' ;
2- import { getAuth } from 'firebase/auth' ;
2+ import { initializeAuth , getReactNativePersistence } from 'firebase/auth' ;
33import Constants from 'expo-constants' ;
4+ import AsyncStorage from '@react-native-async-storage/async-storage' ;
45
56// add firebase config
67const firebaseConfig = {
@@ -9,13 +10,15 @@ const firebaseConfig = {
910 projectId : Constants . manifest . extra . projectId ,
1011 storageBucket : Constants . manifest . extra . storageBucket ,
1112 messagingSenderId : Constants . manifest . extra . messagingSenderId ,
12- appId : Constants . manifest . extra . appId
13+ appId : Constants . manifest . extra . appId ,
1314} ;
1415
1516// initialize firebase
16- initializeApp ( firebaseConfig ) ;
17+ const app = initializeApp ( firebaseConfig ) ;
1718
1819// initialize auth
19- const auth = getAuth ( ) ;
20+ const auth = initializeAuth ( app , {
21+ persistence : getReactNativePersistence ( AsyncStorage ) ,
22+ } ) ;
2023
2124export { auth } ;
Original file line number Diff line number Diff line change 99 },
1010 "dependencies" : {
1111 "@expo/vector-icons" : " ^13.0.0" ,
12+ "@react-native-async-storage/async-storage" : " ~1.17.3" ,
1213 "@react-native-masked-view/masked-view" : " 0.2.6" ,
1314 "@react-navigation/native" : " ^6.0.6" ,
1415 "@react-navigation/stack" : " ^6.0.11" ,
1516 "dotenv" : " ^10.0.0" ,
1617 "expo" : " ^45.0.0" ,
1718 "expo-constants" : " ~13.1.1" ,
18- "firebase" : " 9.1.0 " ,
19+ "firebase" : " 9.6.11 " ,
1920 "formik" : " 2.1.4" ,
2021 "react" : " 17.0.2" ,
2122 "react-dom" : " 17.0.2" ,
You can’t perform that action at this time.
0 commit comments