Posts

Showing posts from March, 2025
Chat App Login to Chat Login with Google Send Logout body { font-family: Arial, sans-serif; text-align: center; background-color: #f5f5f5; } .hidden { display: none; } #chat-container { width: 100%; max-width: 400px; margin: auto; background: white; padding: 10px; border-radius: 8px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); } #messages { height: 300px; overflow-y: auto; border: 1px solid #ddd; padding: 10px; margin-bottom: 10px; } #message-input { width: 75%; padding: 8px; } button { padding: 8px 12px; margin-top: 10px; background-color: #007bff; color: white; border: none; cursor: pointer; } button:hover { background-color: #0056b3; }// Firebase Configuration import { initializeApp } from "https://www.gstatic.com/firebasejs/10.8.1/firebase-...
npx create-expo-app ChatApp cd ChatApp npm install firebase expo-google-auth-session react-native-gifted-chat import { initializeApp } from "firebase/app"; import { getAuth } from "firebase/auth"; import { getFirestore } from "firebase/firestore"; const firebaseConfig = { apiKey: "YOUR_API_KEY", authDomain: "YOUR_AUTH_DOMAIN", projectId: "YOUR_PROJECT_ID", storageBucket: "YOUR_STORAGE_BUCKET", messagingSenderId: "YOUR_MESSAGING_SENDER_ID", appId: "YOUR_APP_ID", }; const app = initializeApp(firebaseConfig); export const auth = getAuth(app); export const db = getFirestore(app); import { useEffect, useState } from "react"; import { Button, View, Text } from "react-native"; import * as Google from "expo-auth-session/providers/google"; import { auth } from "./firebaseConfig"; import { signInWithCredential, GoogleAuthProvider } from "firebase/au...