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

341
Views
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
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!