Back story: I'm developing an app that communicates with a personal medical device. We use critical alerts when we have hardware issues that could result in harm to the patient. The audio file is a 30 second file to make sure the patient is aware. If the app is open when they occur, we pop up a modal message in the app. When the user dismisses the notice, we call UNNotificationCenter::removeDeliveredNotifications(withIdentifiers:) to
remove the critical alert and also to stop the audio file that is playing.
This normally works fine. However we discovered that if the patient leaves critical alert enabled but disables notifications for our app, that we can still post the critical alert and it goes off. However when the user dismisses the message, the removeDeliveredNotifications
call does not work. I did some debugging and if call getDeliveredNotifications with
this permission combination, it return 0 (normally it would return 1).
Does anyone know of another way to remove the critical alert in this situation? (or should I be submitting this as a bug?)