1

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

2 回答 2

4

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!

于 2010-03-04T23:32:05.297 回答
1

现在您可以使用本地通知而不是推送通知。在 iOS 4.0 中可用。

于 2010-09-27T12:28:03.100 回答