0

I've read several posts on creating a timer that runs in the background. Is it possible to create a scheduled timer that will continue to run once the app has been suspended/terminated?

Apple's own timer achieves this, but it's not clear how. I am guessing they send a local notification for the timer expiry, and maybe they undertake a date object comparison if the app is brought to the foreground while still in the countdown period. Is this a correct assumption? Any pointers would be helpful.

1 Answers1

1

In short, what you're looking to do is not possible - since the amount of time your app is allowed to run in the background is limited to ~3 minutes. Look at this answer for more details.

You could achieve your goal through the use of a push notification, but that would require a server and won't guarantee it is received at the perfect time.

You might also want to look at this question

It also appears based on this answer that you cannot set a timer in the standard clock app either.

TLDR - You can't create a timer app.

DoesData
  • 6,594
  • 3
  • 39
  • 62