diff --git a/.gitignore b/.gitignore index 5f1d955..bb340da 100644 --- a/.gitignore +++ b/.gitignore @@ -21,4 +21,7 @@ package-lock.json npm-debug.log* yarn-debug.log* -yarn-error.log* \ No newline at end of file +yarn-error.log* + +#firebase functions +/functions \ No newline at end of file diff --git a/functions/.gitignore b/functions/.gitignore index 40b878d..7baffc7 100644 --- a/functions/.gitignore +++ b/functions/.gitignore @@ -1 +1,2 @@ -node_modules/ \ No newline at end of file +node_modules/ +index.js \ No newline at end of file diff --git a/functions/index.js b/functions/index.js index a4f061f..a890f8e 100644 --- a/functions/index.js +++ b/functions/index.js @@ -5,9 +5,6 @@ const nodemailer = require('nodemailer'); const cors = require('cors')({ origin: true }); admin.initializeApp(); -/** -* Here we're using Gmail to send -*/ let transporter = nodemailer.createTransport({ service: 'gmail', auth: { diff --git a/src/app/initDb.js b/src/app/initDb.js index 8a2c6a3..2dfc7a0 100644 --- a/src/app/initDb.js +++ b/src/app/initDb.js @@ -1,6 +1,6 @@ import * as firebase from 'firebase' import { keys } from './keys' -// import { ENV, API_KEY, AUTH_DOMAIN, DB_URL, PROJECT_ID, STORAGE_BUCKET, MSG_SENDER_ID } from 'react-native-dotenv' +import { ENV, API_KEY, AUTH_DOMAIN, DB_URL, PROJECT_ID, STORAGE_BUCKET, MSG_SENDER_ID } from 'react-native-dotenv' // console.log("TCL: ENV", ENV) @@ -13,12 +13,12 @@ import { keys } from './keys' // messagingSenderId: MSG_SENDER_ID // } const firebaseConfig = { - apiKey: keys.apiKey, - authDomain: keys.authDomain, - databaseURL: keys.databaseURL, - projectId: keys.projectId, - storageBucket: keys.storageBucket, - messagingSenderId: keys.messagingSenderId + apiKey: API_KEY || keys.apiKey, + authDomain: AUTH_DOMAIN || keys.authDomain, + databaseURL: DB_URL || keys.databaseURL, + projectId: PROJECT_ID || keys.projectId, + storageBucket: STORAGE_BUCKET || keys.storageBucket, + messagingSenderId: MSG_SENDER_ID || keys.messagingSenderId } export default () => { diff --git a/src/views/help/HelpView.js b/src/views/help/HelpView.js index a11f1e5..abd50a7 100644 --- a/src/views/help/HelpView.js +++ b/src/views/help/HelpView.js @@ -27,6 +27,7 @@ class HelpView extends Component { const sendEmailFirebaseFunctionUrl = `https://us-central1-happrev.cloudfunctions.net/sendMail?name=${first} ${last}&email=${email}&phone=${phone}&content=${content}` fetch(sendEmailFirebaseFunctionUrl) .then((response) => { + console.log("TCL: HelpView -> SandMessage -> response", response) this.setState({ success: true, modalVisible: true, loading: false }) }).catch((error) => { this.setState({ modalVisible: true, loading: false })