Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

155
Visualizações
How can I play a ringtone on an Android device when receiving push-notification in a PWA?

I have a PWA that is used in a controlled environment (meaning it's only used by a few people, so I have access to all the devices, so I have much room for workarounds). The PWA can be installed, that's how it's used on Android devices. I have a service-worker that caches the files. The PWA receives push-notifications through Firebase Messaging.

I send this to get a push-notification:

notification:
        {
            title:"Video call!",
            body:"Videó call from:"+m,
            click_action: "https://examplesite.app/?x="+m,
            sound: "default",
            vibrate: [200, 100, 200, 100, 200, 100, 200]
        }

My problem is I want the PWA to play a longer ringtone in the background when a push-notification comes in, just like when a normal call comes in on the phone. How can I achieve this? I have read that browsers do not support such things, however I am trying to look for any kind of workaround. If the service-worker could play a ringtone whenever there's an incoming push-notification, it would be great. I only need to achieve this on mobile devices, however at this point I can't rework the PWA into an Android application if that could make a difference. I could write a tiny Android application that's only there to listen for such notifications and play music, if it's even possible.

So is there any way I can make the PWA play a ringtone when there is a push-notification coming in?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda