Skip to content

Commit

Permalink
Adjusting environment.
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewTurk247 committed Oct 4, 2022
1 parent 0a27991 commit 0a7f5fa
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions App.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import * as Device from "expo-device"
import * as Notifications from "expo-notifications"
import { initializeApp } from "firebase/app"
import { getDatabase, ref, push, set } from "firebase/database"
import { getAuth, signInWithCredential, signInWithEmailAndPassword } from "firebase/auth"
import { APIKEY, MESSAGING_SENDER_ID, APP_ID, MEASUREMENT_ID, FIREBASE_PASSWORD, SERVICE_ACCOUNT_ID } from "@env"
import { getAuth, signInWithEmailAndPassword } from "firebase/auth"
import { Strings } from "./constants"
import * as eva from "@eva-design/eva"
import { ApplicationProvider, Icon, IconRegistry, Text } from "@ui-kitten/components"
Expand Down Expand Up @@ -36,15 +35,15 @@ Notifications.setNotificationHandler({
})

const firebaseConfig = {
apiKey: APIKEY,
apiKey: process.env.APIKEY,
authDomain: "daily-mobile-app-notifications.firebaseapp.com",
databaseURL: "https://daily-mobile-app-notifications-default-rtdb.firebaseio.com",
projectId: "daily-mobile-app-notifications",
storageBucket: "daily-mobile-app-notifications.appspot.com",
messagingSenderId: MESSAGING_SENDER_ID,
appId: APP_ID,
measurementId: MEASUREMENT_ID,
serviceAccountId: SERVICE_ACCOUNT_ID
messagingSenderId: process.env.MESSAGING_SENDER_ID,
appId: process.env.APP_ID,
measurementId: process.env.MEASUREMENT_ID,
serviceAccountId: process.env.SERVICE_ACCOUNT_ID
}

const Stack = createStackNavigator()
Expand Down Expand Up @@ -167,7 +166,7 @@ export default function App() {

if (matches) {
var submatch = matches[1]
signInWithEmailAndPassword(auth, "[email protected]", FIREBASE_PASSWORD).then((userCredential) => {
signInWithEmailAndPassword(auth, "[email protected]", process.env.FIREBASE_PASSWORD).then((userCredential) => {
const tokenRef = ref(db, "ExpoPushTokens/" + submatch, userCredential)
set(tokenRef, Date())
})
Expand Down Expand Up @@ -208,7 +207,7 @@ export default function App() {
<NavigationContainer onStateChange={e => {
const name = getActiveRouteName(e)
if (!(name in seen)) {
signInWithEmailAndPassword(auth, "[email protected]", FIREBASE_PASSWORD).then((userCredential) => {
signInWithEmailAndPassword(auth, "[email protected]", process.env.FIREBASE_PASSWORD).then((userCredential) => {
const analyticsRef = ref(db, "Analytics/", userCredential)
push(analyticsRef, JSON.stringify(e)) // Still figuring out how to format as an object in Firebase.
})
Expand Down

0 comments on commit 0a7f5fa

Please sign in to comment.