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

244
Visualizações
Send A Notification when PWA is Closed

I have made a PWA Todo List App (Link To App) using Angular. I am now planning on adding Notifications which can reach the user when the app is closed. Since it is a PWA which works offline, I cannot depend on Push Notifications. Thanks in advance

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You can make use of Web Periodic Background Sync API You can run this feature offline too and even app is closed, it doesn't require backend server for push as it triggers by the service worker periodically (min 24 hr I guess)

in your project files register sync event:

registration.periodicSync.register(constants.periodicBgSyncEventName, {
    minInterval: syncMinInterval,
    networkState: "any",
});

in your service worker file listen to the sync and show web notification:

self.addEventListener("periodicsync", (event) => {
  if (event.tag === constants.periodicBgSyncEventName) {
    self.registration.showNotification("Wake Time !!!", {
      body: `Hi, Good Morning`,
    });
  }
});

Note - In order to use this Periodic Sync API you need to install the PWA first.

about 4 years ago · Juan Pablo Isaza Relatório
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