La Casa del Bordadito uses Firebase Authentication to manage every user session. Two sign-in methods are available: email/password (with mandatory email verification) and Google Sign-In via Google Play Services. Both paths converge on the same Realtime Database user record and tie into OneSignal for targeted push notifications.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/AndresLopezCorrales/La-casa-del-bordadito/llms.txt
Use this file to discover all available pages before exploring further.
- Email / Password
- Google Sign-In
Register a new account
From the login options screen (
On submit,
OpcionesLogin), tap Ingresar con Email, then tap the Registrarme link to open Registro_email.Fill in three fields:| Field | Validation |
|---|---|
Must match Patterns.EMAIL_ADDRESS | |
| Password | Must not be empty |
| Repeat password | Must match the first password field |
firebaseAuth.createUserWithEmailAndPassword(email, password) is called. On success the app immediately fires sendEmailVerification() and navigates to VerificarEmailActivity.Verify your email address
VerificarEmailActivity polls Firebase every 3 seconds by calling firebaseAuth.currentUser?.reload() and checking user.isEmailVerified. The screen shows a Reenviar button if the email never arrived.Once the flag flips to true:- The user record is written to
Realtime DB → Usuarios/{uid}withproveedor = "Email". OneSignal.login(uid)links the device for push notifications.- A welcome email is sent via EmailJS.
- The app navigates to
MainActivityand finishes the back-stack.
Sign in to an existing account
Enter email and password on
Login_email and tap Ingresar. The app calls firebaseAuth.signInWithEmailAndPassword(email, password).On success, user.isEmailVerified is checked:- Verified →
comprobarDatosUsuario(uid)confirms the Realtime DB record exists, callsOneSignal.login(uid), and opensMainActivity. - Not verified → a toast is shown, the session is signed out, and the user is redirected to
VerificarEmailActivity.
User record in Realtime Database
Every authenticated user has a document atUsuarios/{uid} in the Firebase Realtime Database. The fields written at registration time are:
| Field | Type | Description |
|---|---|---|
uid | String | Firebase Auth UID |
email | String | Account email address |
nombres | String | Display name (defaults to the part of the email before @ on first login) |
urlImagenPerfil | String | Firebase Storage download URL, empty until set |
proveedor | String | "Email" or "Google" |
fecha_nac | String | Date of birth (set in profile, empty at registration) |
codigoTelefono | String | International dial code, e.g. "+52" |
telefono | String | Phone number without the dial code |
online | Boolean | Real-time presence flag |
escribiendo | String | Typing-indicator flag used in the support chat; empty when not typing |
tiempo | Long | System.currentTimeMillis() at registration |
esAdmin | Boolean | Grants admin panel access |
esSoporte | Boolean | Grants support-chat access |
Online presence tracking
ApplicationClass registers an ActivityLifecycleCallbacks listener at the application level. Whenever the activity count crosses the foreground/background boundary, actualizarEstadoOnline() is called:
.onDisconnect().setValue(false) hook ensures the online flag is cleared by Firebase servers even if the device loses connectivity unexpectedly.
Session check on launch
OpcionesLogin.comprobarSesion() runs every time the login screen is created. It guards against three states:
- No current user → stay on
OpcionesLogin. - Email/password user whose email is unverified → sign out and stay on
OpcionesLogin. - Any verified user → go straight to
MainActivity.
OneSignal device linking
After every successful authentication,com.onesignal.OneSignal.login(user.uid) is called. This associates the device’s push token with the Firebase UID so that targeted notifications (e.g., order updates, workshop announcements) are delivered to the correct person.