This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createUserWithEmailAndPassword } from "firebase/auth"; | |
import React, { useState } from "react"; | |
import Button from 'react-bootstrap/Button'; | |
import Form from 'react-bootstrap/Form'; | |
import { useNavigate } from "react-router-dom"; | |
import { auth, db } from '../firebase'; | |
import { doc, setDoc, collection } from 'firebase/firestore'; | |
function Register() { | |
const [username, setUsername] = useState(); | |
const [password, setPassword] = useState(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createUserWithEmailAndPassword, signInWithEmailAndPassword } from "firebase/auth"; | |
import React, { useState } from "react"; | |
import Button from 'react-bootstrap/Button'; | |
import Form from 'react-bootstrap/Form'; | |
import { useNavigate } from "react-router-dom"; | |
import { auth } from '../firebase'; | |
function Login() { | |
const [username, setUsername] = useState(); | |
const [password, setPassword] = useState(); | |
const navigate = useNavigate(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logo from './logo.svg'; | |
import './App.css'; | |
import 'bootstrap/dist/css/bootstrap.min.css'; | |
import { | |
BrowserRouter, | |
Routes, //replaces "Switch" used till v5 | |
Route, | |
} from "react-router-dom"; | |
import Register from './screens/Register'; | |
import Home from './screens/Home'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { initializeApp } from 'firebase/app'; | |
import { initializeFirestore } from 'firebase/firestore' | |
import { getAuth } from "firebase/auth"; | |
const firebaseConfig = { | |
apiKey: "<your_project_key>", | |
authDomain: "<your_project_key>", | |
projectId: "<your_project_key>", | |
storageBucket: "<your_project_key>", | |
messagingSenderId: "<your_project_key>", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const FCM = require('fcm-node'); | |
// put your server key here | |
const serverKey = '<your-server-key>'; | |
const fcm = new FCM(serverKey); | |
function sendNotificationToFirebase(message) { | |
return new Promise((resolve, reject) => { | |
fcm.send(message, (err, response) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$RNFirebaseAsStaticFramework = true | |
require_relative '../node_modules/react-native/scripts/react_native_pods' | |
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' | |
platform :ios, '12.4' | |
install! 'cocoapods', :deterministic_uuids => false | |
production = ENV["PRODUCTION"] == "1" | |
target 'chatApp' do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require("express"); | |
const app = express(); | |
const bodyParser = require('body-parser'); | |
const admin = require('firebase-admin'); | |
const serviceAccount = require("./serviceAccountKey.json"); | |
var jsonParser = bodyParser.json() | |
app.use(bodyParser.urlencoded({ | |
extended:true | |
})); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<ion-page> | |
<ion-header :translucent="true"> | |
<ion-toolbar> | |
<ion-title >Camera Application</ion-title> | |
</ion-toolbar> | |
</ion-header> | |
<ion-content :fullscreen="true"> | |
<div class="container"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { | |
StyleSheet, | |
Text, | |
View, | |
AppState | |
} from 'react-native'; | |
import { useEffect, useRef, useState } from 'react'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { | |
StyleSheet, | |
Text, | |
View, | |
AppState | |
} from 'react-native'; | |
import { useEffect, useRef, useState } from 'react'; |