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

159
Views
¿Hay alguna forma de reproducir un sonido de notificación personalizado en la notificación push web (Service Worker)?

He buscado muchos recursos y no he podido encontrar resultados positivos. Quiero reproducir un sonido mientras recibo una notificación automática.

 self.addEventListener("push", (e) => { const data = e.data.json(); // console.log("Push Recieved..."); self.registration.showNotification(data.title, { body: data.message, icon: data?.icon, image: data?.media, url: data?.url, data: { url: data?.url }, vibrate: [ 100, 30, 100, 30, 100, 30, 200, 30, 200, 30, 200, 30, 100, 30, 100, 30, 100, ], }); const playSound = new Audio( "https://notificationsounds.com/storage/sounds/file-b8_discreet-song.mp3" ); playSound.play(); alert("NEW ORDER RECEIVED"); navigator.vibrate([ 100, 30, 100, 30, 100, 30, 200, 30, 200, 30, 200, 30, 100, 30, 100, 30, 100, ]); });

Probé de esta manera también. Pero detecté un error que decía que el audio no es una función.

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!