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

126
Views
sending notifications from service worker

I have a pwa app that basically is a simple form. If the network is offline, it is saved to local storage(indexedDB) and send afterwards when the connection is online. Up to here everything is ok, but I would like to show a message to the user 'the form was sent to the server' and I can't get it working. I use the property 'SYNC' for doing this feature. In my service worker the part of the code relative to this feature is:

self.addEventListener('sync', e => {
    console.log('SW: Sync');
    if ( e.tag === 'new-form' ) {

        // send to DB when onLine
        const resp = sendForm(); //up to here all is OK.

        self.registration.showNotification(' Succesfully send to MongoDB');// this line is not working

        e.waitUntil( resp);
    }
}); 

What could be wrong?, in javascript side, It is verified that Notification.permission === 'granted'.

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!