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
| React.useEffect(() => { | |
| return auth().onAuthStateChanged((user) => { | |
| if (user) { | |
| setUser(user); | |
| } else { | |
| setUser(null); | |
| } | |
| }); | |
| }, []); |
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
| try { | |
| await auth().signInWithPopup(provider); | |
| const user = await auth().currentUser; | |
| setUser(user); | |
| } catch(e) {} |
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 { auth } from './firebase'; | |
| function Login() { | |
| const login = async () => { | |
| const provider = new auth.GoogleAuthProvider(); | |
| try { | |
| await auth().signInWithPopup(provider); | |
| } catch (e) {} | |
| }; |
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
| "emulators": "firebase emulators:start --import=data --export-on-exit", |
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
| // src/App.js | |
| import React from 'react'; | |
| import { db } from './firebase'; | |
| function App() { | |
| const [data, setData] = React.useState(); | |
| React.useEffect(() => { | |
| db.doc('people/me') | |
| .get() |
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
| // src/App.js | |
| import React from "react"; | |
| import { db } from "./firebase"; | |
| function App() { | |
| db.doc("hello/world").set({ hello: "world" }); | |
| return <div />; | |
| } | |
| export default App; |
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
| // src/firebase.js | |
| import firebase from 'firebase/app'; | |
| import 'firebase/auth'; | |
| import 'firebase/firestore'; | |
| // TODO: Use a configuration object | |
| firebaseApp.initializeApp({ | |
| projectId: '', | |
| appId: '', |
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
| $ yarn add firebase |
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
| firebase-debug.log* | |
| firestore-debug.log* | |
| ui-debug.log* |
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
| language: objective-c | |
| osx_image: xcode7.3 | |
| before_script: | |
| - openssl aes-256-cbc -k $ENCRYPTION_PASSWORD -in fastlane/Certificates/distribution.p12.enc | |
| -d -a -out fastlane/Certificates/distribution.p12 | |
| script: | |
| - "./fastlane/travis.sh" |
NewerOlder