重复UILocalNotifications与差距 [英] Repeating UILocalNotifications with Gaps

查看:48
本文介绍了重复UILocalNotifications与差距的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一条需要每天重复的通知.用户可以在特定日期将其关闭.是否有使用UILocalNotification框架完成此方案的简便方法?

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?

以一个通知示例为例,该通知从2011年3月1日开始每天重复,并在3月7日和3月23日被禁用.

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个非重复 UILocation3月1日前的通知3月6日
  • 14个非重复3月的UILocation通知3月8日至3月22日
  • 1个重复3月的UILocation通知24日,每天重复
  • 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?

编辑:更不用说每个应用程序正在(迅速)达到64个通知限制.

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.

这篇关于重复UILocalNotifications与差距的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆