views:

48

answers:

2

What are the options(if any) for precisely timed alarms or alerts from within an iphone app? My app may need to alert the user in 30 seconds or 5 hours and 23 seconds.

I assume for shorter times I could just use NSTimer, but what is the cutoff point(if there is one) for a timer to be fired within the app?

For longer timed alarms or alerts I've noticed push notifications have been mentioned, can they be timed to the second, are they reliable? Are there other options?

+1  A: 

You want Local Notificaitons. They are easy to use, and require no server. You simply set them up, and they fire later wether your app is open or not.

Note that this will require iOS4

Also I believe there is a 60 second window your alert may appear in and you probably dont have percise control down to the second about when they appear. Though I haven't tested this myself.

Squeegy
A: 

Take a look at local notifications. You may schedule these using NSDate, which, for example, allows you to schedule an alert in an interval with a precision down to seconds from the current time.

See: Local and Push Notifications

Toastor