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

258
Views
FCM browser notification not working in Vue 3

Here's my code. So far I've managed to get the background notification working. (Onmessage not working)

"firebase": "^9.6.7",

firebase-messaging-sw.js

null

App.vue

import { initializeApp } from 'firebase/app';
import { getMessaging, getToken, onMessage  } from "firebase/messaging";

const firebaseConfig = {
      apiKey: "AIzaSyDXnUaeAK",
      authDomain: "test-test.firebaseapp.com",
      projectId: "test-test",
      storageBucket: "test-test.appspot.com",
      messagingSenderId: "123456789",
      appId: "1:38296:web:j88054626",
      measurementId: "X-TEST"
    };
    initializeApp(firebaseConfig);
    const messaging = getMessaging();
    getToken(messaging, { vapidKey: 'key' })
    .then((currentToken) => {
      console.log("currentToken", currentToken);
      
    })
    onMessage(messaging, (payload) => {
      console.log('Message received. ', payload);
      // ...
    });

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!