Repeating UILocalNotifications with Gaps

↘锁芯ラ 提交于 2019-12-22 10:13:12

问题


I have a notification that needs to repeat daily. It can be turned off by the user for specific 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.


回答1:


I don't see anyway to establish repeats only for a range of dates.




回答2:


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.:)



来源:https://stackoverflow.com/questions/5203920/repeating-uilocalnotifications-with-gaps

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!