我正在开发一个基于SwiftUI的Todos应用程序。如果用户没有完成今天的待办事项,我可以使用UserNotifications来实现通知功能。目前,我想取消当天的通知,如果用户完成他们的待办事项。那么,如何基于UserNotifications实现呢?
发布于 2022-06-03 17:31:13
立即移除所有的东西:
UNUserNotificationCenter.current().removeAllPendingNotificationRequests()单独移除:
UNUserNotificationCenter.current().removePendingNotificationRequests(withIdentifiers: [<ids you want to cancel>])https://stackoverflow.com/questions/72490842
复制相似问题