I am using UNUserNotificationCenter to get delivered notifications like so:
UNUserNotificationCenter.current().getDeliveredNotifications { (notifications) in
self.array = notifications
}
and then on viewWillDisappear I am clearing the applicationIconBadgeNumber like so:
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
UIApplication.shared.applicationIconBadgeNumber = 0
}
Doing this does not make my notifications last long, yes I would like the badge number to be at 0 after you see the notifications, but I would like those ones to last for 24 - 48 hours....How can I accomplish this?