简体   繁体   English

自动从iOS通知中心删除UILocalNotification

[英]Delete UILocalNotification from iOS Notification Center automatically


I'm trying to send UILocalNotifications and delete them automatically after a certain interval from the Notification Center. 我正在尝试发送UILocalNotifications并在通知中心一定时间间隔后自动删除它们。
My app sends information to users that in about 5 minutes since sending would be irrelevant. 我的应用程序在大约5分钟内向用户发送信息,因为发送将无关紧要。
There are going to be at least 3 notifications a day. 每天至少会有3个通知。
Since the information of the notifications would be irrelevant in a few minutes, it would be much better to delete those notifications from Notification Center - because they would be irrelevant to the user. 由于通知信息在几分钟内无关紧要,因此从通知中心删除这些通知会好得多 - 因为它们与用户无关。

Is there any way to achieve this? 有没有办法实现这个目标? Sort kind of a "self-destruction" option of local notifications? 对本地通知的“自毁”选项进行排序?

Thank you! 谢谢!

If your question is to remove the notifications from the notification centre even without bringing the application to foreground(new notification to clear the old notifications), then the answer is straight forward "NO". 如果您的问题是要从通知中心删除通知,即使没有将应用程序带到前台(清除旧通知的新通知),那么答案是直接的“否”。

Without user accepting the older notification or manually brings the application to foreground - It is not possible. 没有用户接受旧通知或手动将应用程序带到前台 - 这是不可能的。

A possibility if this feature may come out with iOS7! 这个功能可能会出现在iOS7上!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从通知中心点击时,UILocalNotification不会触发didReceiveLocalNotification - UILocalNotification doesn't trigger didReceiveLocalNotification when tapping from Notification Center UILocalNotification - 如何发现用户操作是否来自通知中心? - UILocalNotification - How to discover whether user action came from notification center? 如何在特定时间自动删除iOS通知中心的推送通知? - How to automatically delete push notifications from iOS notification centre at a specific time? UILocalNotification被触发但不显示,或者在通知中心中显示但不可见,或者像超级按钮一样触发 - UILocalNotification fired but not showing, or showing but not visible in notification center, or firing like a charm 当应用程序处于后台时,UILocalNotification不会显示在通知中心中 - UILocalNotification not showing up in Notification Center when app is in background iOS示例代码可从通知中心清除我的应用程序通知? - iOS Sample Code to clear my application notification from Notification Center? 以编程方式从通知托盘中删除UILocalNotification - Removing UILocalNotification from notification tray programmatically iOS小工具和通知中心 - iOS Widgets & Notification Center iOS5中的通知中心 - Notification Center in iOS5 iOS 5“通知中心”API? - iOS 5 “Notification Center” API?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM