可以创建“隐藏”日历项目在 iPhone 应用程序中显示通知警报?
我正在开发一个包含用户生成事件的应用程序。就应用程序目前的情况而言,将事件添加到用户日历的选项是可选的(这不应该改变,因为该事件可能已经从其他地方出现在日历上)。
无论如何,我想让用户可以选择在活动之前从应用程序收到通知。显然,如果用户选择将事件添加到他们的日历中,那么最好的方法(我认为)是使用日历事件的警报。
但是,如果用户未将事件添加到其日历中,此选项是否可用于该事件?我仍然想为他们提供通知选项...我想我是在问 - 有没有办法创建一个“隐藏”日历事件,仅供应用程序使用,并使用它来发送用户设置的警报在应用程序中?
看起来这比设置推送通知要简单得多。关于这个主题的任何想法,或者我如何批准我的方法,将不胜感激。
I am working on an app that incorporates user-generated events. As the app currently stands, the option to add the event to the user's calendar is optional (and this should not change, because the event could already be on the calendar from somewhere else).
I want to give the users the option to be notified before their event from the app in any case. Obviously, if the user has selected to add the event to their calendar, the best way (I believe) would be to use the alarms for the calendar event.
However, is this option available for an event if the user does not add it to their calendar? I would still like to give them options for notification... I guess I am asking - is there a way to create a 'hidden' calendar event, just for the use of the app, and use it to send the alarms the user sets up in the app?
It seems like this would be so much more straightforward than setting up push notifications. Any thoughts on the subject, or how I could approve my approach, would be much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用类似于推送通知的本地通知,但不需要服务器。这些在 OS4+ 中可用。
这里是使用它们的教程。
You can use local notifications which are like push notifications but don't require a server. These are available in OS4+.
Here is a tutorial on using them.