Repeating UILocalNotifications with Gaps
I have a notification that needs to repeat daily. It can be turned off by the user for specif开发者_如何学Cic days. Is there any easy way to accomplish this scenario using the UILocalNotification framework?
Take an example of a notification that repeats daily starting on March 1st, 2011, and is disabled for March 7th, and March 23rd.
The only solution I've come up with is to create:
- 6 non-repeating UILocation notifications for March 1st through March 6th
- 14 non-repeating UILocation notifications for March 8th through March 22nd
- 1 repeating UILocation notification for March 24th, repeating daily
This is doable, but requires re-evaulation every time the user changes the deletion dates. Is this the best way to accomplish this type of scenario?
Edit: Not to mention the fact that this is approaching (rapidly) the 64-notification limit per app.
I don't see anyway to establish repeats only for a range of dates.
For these kind of alarm problems where app has to set notification that repeats irregularly, the best way is to use push notifications. i spent my 2 month wasting on this kind of problem and at last i have to turn to push notifiction. So try push notification asap.:)
精彩评论