[英]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.