-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfirebaseConfig.ts
More file actions
32 lines (30 loc) · 899 Bytes
/
Copy pathfirebaseConfig.ts
File metadata and controls
32 lines (30 loc) · 899 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { getApp, getApps, initializeApp } from "firebase/app";
import {
getAuth,
getReactNativePersistence,
initializeAuth,
} from "firebase/auth/react-native";
import AsyncStorage from "@react-native-async-storage/async-storage";
const firebaseConfig = {
apiKey: "AIzaSyCSa_2xDHzbli_1H2O8IR0K9hMbUQ2N95I",
authDomain: "control-qr-380300.firebaseapp.com",
projectId: "control-qr-380300",
storageBucket: "control-qr-380300.appspot.com",
messagingSenderId: "911129246688",
appId: "1:911129246688:web:435b3f17a29660dc650985",
measurementId: "G-WC849PQ6XB",
};
let app, auth;
if (!getApps().length) {
try {
app = initializeApp(firebaseConfig);
auth = initializeAuth(app, {
persistence: getReactNativePersistence(AsyncStorage),
});
} catch (error) {
console.warn("Error initializing app: " + error);
}
} else {
app = getApp();
auth = getAuth(app);
}