【发布时间】:2016-12-22 18:09:34
【问题描述】:
从 iOS 10 和 UNUserNotificationCenter 开始,很多事情都可以通过通知实现,但我不知道如何远程删除推送通知每次。
使用mutable-content 属性,我可以修改推送通知的内容。
但是假设我想稍后将其删除(内容已过期)。我使用了content-available,然后是以下代码:
UNUserNotificationCenter.current()
.removeDeliveredNotifications(withIdentifiers: [xxx])
它几乎可以工作,除了(这是一个主要问题)应用程序被用户刷出内存时。
有没有人找到删除通知的方法?
【问题讨论】:
标签: ios swift apple-push-notifications ios10