From 9eac02ff55139b33fea0757d0cd5acf84937c1d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anna-Lena=20M=C3=BCller?= <anna-lena.mueller@student.reutlingen-university.de> Date: Tue, 12 Apr 2022 08:55:25 +0000 Subject: [PATCH] Update --- Firebase.js | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 Firebase.js diff --git a/Firebase.js b/Firebase.js new file mode 100644 index 0000000..e7aa251 --- /dev/null +++ b/Firebase.js @@ -0,0 +1,56 @@ +import { initializeApp } from "firebase/app"; +import { getAnalytics } from "firebase/analytics"; +import { getFirestore, collection, getDocs } from 'firebase/firestore'; + +//import * as firebase from 'firebase'; +//import 'firebase/firestore' + + + +/*const firebaseConfig = { + apiKey: "AIzaSyCNhZTcHSLaIGjP-fzpPrqRTAiWZB9jLos", + authDomain: "exercise-react-native-433ff.firebaseapp.com", + projectId: "exercise-react-native-433ff", + storageBucket: "exercise-react-native-433ff.appspot.com", + messagingSenderId: "293211634805", + appId: "1:293211634805:web:e02756294908e9734ecc3c", + measurementId: "G-R25TM36Y33" + }; + + // Initialize Firebase + const app = initializeApp(firebaseConfig); + //const analytics = getAnalytics(app); + //const db = getFirestore(app); + + // Get a list of cities from your database +/*async function getCities(db) { + const citiesCol = collection(db, 'cities'); + const citySnapshot = await getDocs(citiesCol); + const cityList = citySnapshot.docs.map(doc => doc.data()); + return cityList; + }*/ + + + + +const firebaseConfig = { + apiKey: "AIzaSyCNhZTcHSLaIGjP-fzpPrqRTAiWZB9jLos", + authDomain: "exercise-react-native-433ff.firebaseapp.com", + projectId: "exercise-react-native-433ff", + storageBucket: "exercise-react-native-433ff.appspot.com", + messagingSenderId: "293211634805", + appId: "1:293211634805:web:99405940c89de56e4ecc3c", + measurementId: "G-JJPHT7LEPD" +}; + + +const app = initializeApp(firebaseConfig); +//const analytics = getAnalytics(app); + + export default getFirestore(); + + /*const app = firebase.initializeApp(firebaseConfig); + export const fireDB = app.firestore(); + export default app;*/ + + \ No newline at end of file -- GitLab