使用间隙重复UILocalNotifications(Repeating UILocalNotifications with Gaps)

编程入门 行业动态 更新时间:2024-10-28 16:25:25
使用间隙重复UILocalNotifications(Repeating UILocalNotifications with Gaps)

我有一个需要每天重复的通知。 用户可以在特定日期关闭它。 有没有简单的方法可以使用UILocalNotification框架完成这个场景?

以2011年3月1日开始每日重复的通知为例,并于3月7日和3月23日停用。

我想出的唯一解决方案是创建:

3月1日至3月6日的6次非重复 UILocation通知 3月8日至3月22日的14次非重复 UILocation通知 1 重复 3月24日的UILocation通知,每天重复

这是可行的,但每次用户更改删除日期时都需要重新评估。 这是完成此类场景的最佳方式吗?

编辑:更不用说这个(快速)接近每个应用程序64通知限制的事实。

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.

最满意答案

我不认为无论如何只为一系列日期建立重复。

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

更多推荐

本文发布于:2023-07-22 12:08:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1219884.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:间隙   UILocalNotifications   Gaps   Repeating

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!