Mac
Mac

Reputation: 14791

Scheduling iPhone application execution

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:

Does anyone know of a better alternative?

Upvotes: 1

Views: 450

Answers (2)

apoorv shah
apoorv shah

Reputation: 171

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

Upvotes: 1

Ben Gottlieb
Ben Gottlieb

Reputation: 85532

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!

Upvotes: 4

Related Questions