Skip to content
This repository was archived by the owner on Jul 22, 2026. It is now read-only.

Commit c8ddaaa

Browse files
Merge pull request #72 from expo-community/chore/updates
2 parents 322f9fe + 06a9be6 commit c8ddaaa

3 files changed

Lines changed: 287 additions & 270 deletions

File tree

config/firebase.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { initializeApp } from 'firebase/app';
2-
import { getAuth } from 'firebase/auth';
2+
import { initializeAuth, getReactNativePersistence } from 'firebase/auth';
33
import Constants from 'expo-constants';
4+
import AsyncStorage from '@react-native-async-storage/async-storage';
45

56
// add firebase config
67
const 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

2124
export { auth };

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@
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",

0 commit comments

Comments
 (0)