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

339
Visualizações
Ionic Capacitor - Timer in Background (iOS / Android)

Is it possible to run a timer in the background (in both iOS and Android) or will it be out of the app-guidelines (specifially on iOS). Right now I am having a meditation-timer-app and one of the most important things is that the time should keep on running while in background mode (if the phone display is black or the home screen is opened).

I am using an interval setInterval() - Method of 1000s to count down each second.

https://capacitorjs.com/docs/v2/apis/background-task#background-tasks says it may not be possible:

NOTE: On iOS setTimeout and setInterval won’t work once your app is in background, so don’t use them inside beforeExit.

So another idea that I would have would be to make a calendar event (for example for a Date that is 10 min in the future if you set the timer to 10mins). Than it would be a scheduled timer event. If you reopen the app, the timer gets adapted to the calendar event. Is this possible to wait for a specific date to happen? And how?

Do you have a better solution or can I just use the interval in the background somehow?

For my app this would be very important, since when meditating, you don't want to have the phone open. You want to start the timer and put the phone away.

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