Ich benutze Windows 8. Ich möchte eine App mit this guide. erstellen. In 7 Schritt ändere ich die Datei main.js. Mein Dateiinhalt ist unter:Firebase - Web Chat App Anmeldung Schaltfläche funktioniert nicht
FriendlyChat.prototype.initFirebase = function() {
this.auth = firebase.auth();
this.database = firebase.database();
this.storage = firebase.storage();
this.auth.onAuthStateChanged(this.onAuthStateChanged.bind(this));
};
FriendlyChat.prototype.signIn = function(googleUser) {
var provider = new firebase.auth.GoogleAuthProvider();
this.auth.signInWithPopup(provider);
};
FriendlyChat.prototype.signOut = function() {
this.auth.signOut();
};
FriendlyChat.prototype.onAuthStateChanged = function(user) {
if (user) { // User is signed in!
var profilePicUrl = user.photoURL; // Only change these two lines!
var userName = user.displayName; // Only change these two lines!
....
}
FriendlyChat.prototype.checkSignedInWithMessage = function() {
if (this.auth.currentUser) {
return true;
}
....
Ich erstelle ein Projekt mit Firebase-Konsole. Ich klicke auf "Firebase zu deiner Web-App hinzufügen" und klicke auf das Snippet. Ich füge es in die index.html Datei ein. Der Inhalt der Datei ist unter:
<script src="https://www.gstatic.com/firebasejs/live/3.0/firebase.js"></script>
<script>
// Initialize Firebase
var config = {
apiKey: "AIzaSyAbtFJIZZxExBZec5XjsIE6p_TK4x-NDLE",
authDomain: "xxx-65704.firebaseapp.com",
databaseURL: "https://xxx-65704.firebaseio.com",
storageBucket: "xxx-65704.appspot.com",
};
firebase.initializeApp(config);
</script>
<script src="scripts/main.js"></script>
</body>
Ich führe "fireBase Serve" -Befehl auf cmd-Terminal. Ich öffne localhost:/5000and die Seite unter:
Es ist nicht Web-Chat nicht angezeigt. Also öffne ich we-start/index.html, ich klicke auf "Anmelden bei Google". Aber ich kann mich nicht anmelden. Ich weiß nicht, wie ich dieses Problem beheben kann. Was ist mein Fehler?
ich ändern firebase.json unter Web-Start, aber das Ergebnis nicht ändert .. Neuer Inhalt ist unten: ' "Hosting": { "public": "Web-Start", „umschreibt ": [ { " Quelle ":" ** ", " Ziel ":" /index.html " } ] }' – zumma