views:

178

answers:

2

I'm writing an iPhone app for a client, and they have requested a feature whereby the app "wakes up" at certain times during the day to display a message to the user.

I'm well aware that I can't have the application run in the background and simply move to the foreground at the appropriate time (short of requiring jailbreaking, which isn't really an option for a commercial app). What I'd ideally like would be to simply have the system schedule the application to be run at a particular time of day.

As far as I can tell, the only way to achieve this seems to be to implement push notifications and have a server send the app a message at the appropriate time of day. But this is really ugly and undesirable for several reasons:

  • It requires a constant internet connection on the user's phone (something that I can't really assume)
  • It places a large burden on the server in having to keep track of these times (which may be different for each user)
  • Its just a generally crappy workaround - that's not what push messages are designed for, a dedicated scheduler seems like a much better option.

Does anyone know of a better alternative?

+4  A: 

Currently, this is the only option. File a bug with Apple requesting 'local notifications' (a term I've heard their engineers use in relation to this problem.) Ideally, they would work just as push notifications work now, but not require any net connection. Sorry!

Ben Gottlieb
I thought as much. Had to ask though, just in case. Thanks for your prompt reply!
Mac
+3  A: 

Now you can use local notification instead of push notification. Available in iOS 4.0.

Apoorv
Indeed. However, the question predates iOS 4.0, hence the reason for it in the first place. Thanks though - will definately be useful if the app's ever ported to iOS 4.0.
Mac