EventKit 或 LocalNotification 哪个更好,用于提醒应用程序用户

发布于 2024-12-08 20:17:30 字数 229 浏览 0 评论 0原文

我正在构建一个应用程序,可以提醒用户何时该做某事。我计划使用 EventKit 将事件添加到日历中,这可能会导致日历非常混乱,因为一天中可能会有多个提醒。

LocalNotification 是更合适的解决方案吗?

如果用户想要删除未来发生的事件,删除未来的 LocalNotifications 是否比删除 EventKit 日历事件更容易?

各自的优点和缺点是什么?

谢谢!

I am building an app that reminds users when it's time to do something. I was planning on using EventKit to add events to calendars, which could make for a very cluttered calendar as there could be multiple reminders during a day.

Is LocalNotification a more appropriate solution?

Is it easier to delete future LocalNotifications than EventKit calendar events if the user wants to delete future occurrences?

What are the pros and cons of each?

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

猫性小仙女 2024-12-15 20:17:30

我也在想同样的事情。我认为您想要使用本地通知,因为除了您指出的日历中的混乱之外,您在创建日历事件方面拥有更大的灵活性:
- 您可以选择自定义提醒
- 您可以将提醒启动作为一个选项返回到您的应用程序中,然后自定义您的应用程序从提醒启动时的行为方式(即转到提醒所涉及的特定项目)

此外,Apple 表示您不应该这样做直接在用户的日历中创建事件,但向用户呈现一个对话框并让他们单击“确定”(用于此目的的视图控制器的名称现在我记不清了)。这可能比您对应用程序工作流程的想法多了一步。

一个应用程序可以拥有的本地通知数量有限制 - 我相信是 64 - 因此您可能需要检查 ios5 中是否有更改。

I was thinking over the same thing. I think you want to go with local notifications because, besides less clutter in the calendar as you pointed out, you have more flexibility over creating a calendar event:
- you can choose a custom alert
- you can have the reminder launch back into your app as an option, and then customize how your app will behave when it's launched from a reminder (i.e. go to the specific item that the reminder was about)

Plus Apple says you're not supposed to be creating events directly in the user's calendar, but presenting a dialog to the user and let them click ok (the name of the view controller for this purpose is escaping me right now). This might be an extra step over what you had in mind for your app's workflow.

There was a limit on the number of localnotifications one app could have - 64 i believe- so you may want to check if that's changed in ios5.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文