Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

340
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda