如何在iPhone中进行本地通知?
我想在特定时间后通知用户某件事。有关于这个主题的资源吗?指南或示例代码特别有帮助。我读过很多相关网站,但它们都是关于服务器端通知,例如 Facebook 通知消息到达位置或类似的内容。我只想从 iPhone 应用程序本地触发它,而不涉及服务器。
I want to notify the user about something after some specific time. Are there any resources on this topic? Guides or sample code are particularly helpful. I have read a number of sites about it, but they are all about server side notifications like Facebook notify where if a message arrives or something like that. I just want it triggered locally from the iPhone app with no server involved.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的!您正在寻找
UILocalNotification
。创建并配置它后,您可以 立即呈现 或 安排它在某个时间点出现。换句话说:
真的,这就是全部。
Yep! You're looking for a
UILocalNotification
. Once you've created one and configured it, you can either present it immediately or schedule it to appear at a certain point in time.In other words:
That's all there is to it, really.