0

I am developing a fitness timer for iOS iphone. I want to keep playing audio alerts every x seconds in the background. There can be up to 10 minutes between alerts. (i could live with 5 minutes between alerts). How do you do this in the background? Not nessasary code specifically but i mean how, without application suspending. I mean, localnotifications are limited to 64 messages at a time. 64 messages is not enough at all. I ”round ” has 3 notifications that should be played. A go alert, a rest alert and a warning alert before the rest alert.

I could repeat these notifications because really i only have 3 different alerts and the user is not changing the time interval in the background, however with local notifications you cant select specific repeated alert times of for instance 2 minutes and 5 seconds.

Making a background nstimer to run all the time, to manage when to alert the user with a sound, would be a good solution. However now with ios 7 u cant keep a background thread alive for more then 3 minutes (10 minutes before).

How can apps like ”round timer” do this in the background and for an unlimited time?? I need the approved apple directions of doing this? I just need to know what direction i should be going.

EDIT - this an example of the app im talking about that runs in background. It doenst do localnotifications. Round timer - https://itunes.apple.com/us/app/round-timer-for-fitness-workouts/id376965029?mt=8

aZtraL-EnForceR
  • 1,781
  • 2
  • 16
  • 19

1 Answers1

0

There is a property in the UILocalNotification class called repeatInterval, you can use this to create repeated alarms.

See an example in this answer.

Community
  • 1
  • 1
Enrico Susatyo
  • 19,372
  • 18
  • 95
  • 156