Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

227
Views
¿Por qué no puedo recibir un mensaje de prueba de Firebase Cloud Messaging después de configurar mi aplicación de Firebase?

Estoy tratando de usar la consola de firebase para enviar mensajes de prueba a mi aplicación que ya se configuró y estoy recuperando el token con éxito, pero no veo ningún mensaje cuando intento enviar un mensaje de prueba a través de la consola de mensajería de firebase. La documentación es un poco confusa o tal vez simplemente apesto en el desarrollo

Aquí está mi archivo firebase-config.js

 import { initializeApp } from "firebase/app"; import {getFirestore} from "@firebase/firestore"; import { getMessaging, getToken, onMessage } from "firebase/messaging"; //Change all these properties to ENV vars const firebaseConfig = { apiKey: "AIzaSyA6dRIuOURWsb0ZnJ7u7PiuUlmKH7iw3ww", authDomain: "moby-3fda9.firebaseapp.com", databaseURL: "https://moby-3fda9-default-rtdb.firebaseio.com", projectId: "moby-3fda9", storageBucket: "moby-3fda9.appspot.com", messagingSenderId: "48918745183", appId: "1:48918745183:web:547b4415d00949b1634bea", measurementId: "G-FL67YXFVY8" }; //intitialize app needs to happen first before getting the messaging object const app = initializeApp(firebaseConfig); const messaging = getMessaging(); getToken(messaging, { vapidKey: 'BFEKQoDdONC12U2EfGB21eUGo8U08A37Mfn_E3i9FHCsuTocudQRxpxmxjlpxHEXX3Lqjep1hpNwhq1STngJo_k' }).then((currentToken) => { if (currentToken) { // Send the token to your server and update the UI if necessary // ... console.log("got the token", currentToken) } else { // Show permission request UI console.log('No registration token available. Request permission to generate one.'); // ... } }).catch((err) => { console.log('An error occurred while retrieving token. ', err); // ... }); onMessage(messaging, (payload) => { console.log('Message received. ', payload); }); export const db = getFirestore(app);

Puedo ver el token registrado en la consola, pero no puedo ver ningún mensaje recibido cuando intento enviar un mensaje de prueba desde la consola de Firebase.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!