This file contains 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 WebView from 'react-native-webview'; | |
import auth from '@react-native-firebase/auth'; | |
const LoginScreen = ({navigation}) => { | |
return ( | |
<View style={{flex: 1}}> | |
<WebView | |
// The server should be accessed from emulator's localhost, otherwise | |
// you forgot to execute: | |
// |
This file contains 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
<script> | |
... | |
// We'll inform React Native about errors using this function | |
function sendErrorMessage(error) { | |
window.ReactNativeWebView.postMessage( | |
JSON.stringify({ | |
"type": "error", | |
"data": undefined, | |
"error": error | |
}) |
This file contains 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
<script> | |
... | |
function signIn(providerName) { | |
// Optional: Send an event from webview to React Native | |
sendMessage("event", "click-on-login"); | |
if (!firebase.auth().currentUser) { | |
var provider; | |
if (providerName === 'google') { |
This file contains 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
... | |
<script> | |
// Fill this object with your app data. See | |
// https://firebase.google.com/docs/web/setup#config-object | |
var firebaseConfig = { | |
apiKey: '...', | |
authDomain: '...', | |
databaseURL: '...', | |
projectId: '...', |
This file contains 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
... | |
<script src="https://www.gstatic.com/firebasejs/8.2.6/firebase-app.js"></script> | |
<script src="https://www.gstatic.com/firebasejs/8.2.6/firebase-auth.js"></script> | |
... |
This file contains 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
<html lang="ro"> | |
<head> | |
<title>Login</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Open+Sans"/> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> | |
<style type="text/css"> | |
body { | |
background-color: #fbfbfb; | |
} |
This file contains 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
xset -display :0.0 dpms force off |