Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

312
Vistas
Reaccionar con Firebase signInWithPhoneNumber Nada sucede al hacer clic en el botón

Estoy tratando de crear una aplicación simple que permita iniciar sesión con un número de teléfono, pero parece que no hace absolutamente nada cuando hago clic en el botón que dice "setupCaptcha".

La línea: import firebase from '../firebase' (línea 5) no hace absolutamente nada (no se hace referencia en ninguna parte del código), pero cuando lo comento me da este error: Firebase: No Firebase App '[DEFAULT]' has been created - call Firebase App.initializeApp() (app/no-app). cuando lo elimino, el clic del botón no hace absolutamente nada.

 import React from 'react' import { useHistory } from 'react-router-dom' import { MainButton } from '../components/MainButton' import { MainInput } from '../components/MainInput' import firebase from '../firebase' // import { getAuth, RecaptchaVerifier, signinWithPhoneNumber } from "firebase/auth"; import { getAuth, RecaptchaVerifier, signInWithPhoneNumber } from "firebase/auth"; export default function EnterPhoneNumber() { const history = useHistory(); // const phoneNumber = getPhoneNumberFromUserInput(); function setupCaptcha() { const auth = getAuth(); window.recaptchaVerifier = new RecaptchaVerifier('sign-in-button', { 'size': 'invisible', 'callback': (response) => { // reCAPTCHA solved, allow signInWithPhoneNumber. // onSignInSubmit(); onSignInSubmit() } }, auth); } function onSignInSubmit() { const auth = getAuth(); const appVerifier = window.recaptchaVerifier; signInWithPhoneNumber(auth, "+447xxxxxxxxx", appVerifier) .then((confirmationResult) => { // SMS sent. Prompt user to type the code from the message, then sign the // user in with confirmationResult.confirm(code). window.confirmationResult = confirmationResult; // ... }).catch((error) => { // Error; SMS not sent // ... }); }

Este es mi archivo firebase.js :

 import firebase from 'firebase/compat/app' // import 'firebase/compat/auth' const app = firebase.initializeApp({ apiKey: "xxxxxxx", authDomain: "xxxxxx.firebaseapp.com", projectId: "xxxxxx", storageBucket: "xxxxxxxx.appspot.com", messagingSenderId: "xxxxxxxx", appId: "xxxxxxxxxx" }) // export const auth = app.auth(); export default firebase;
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda