Post

Replies

Boosts

Views

Activity

Reply to Scheduled local notifications mysteriously disappearing
@funju, yes I did but it was just me overlooking older code. Basically a long time ago in the app I had a simple timer notification and if the user cancels it I naively removed the pending notification by calling: UNUserNotificationCenter.current().removeAllPendingNotificationRequests() Which unscheduled all notifications, including the ones that were "mysteriously" disappearing. It's unlikely but I'd suggest doing a simple search of your code base to make sure that isn't being called. So it was an easy fix by replacing that line with: UNUserNotificationCenter.current().getPendingNotificationRequests { requests in let timerRequests = requests .filter({ $0.content.categoryIdentifier == self.timerNotificationCategoryIdentifier })   .map({ $0.identifier }) UNUserNotificationCenter.current().removePendingNotificationRequests(withIdentifiers: timerRequests) }
Oct ’22