Is there any way to create a notification that cannot be dismissed in iOS? It can even be a workaround (e.g. listening for the notification to be cleared and showing up a ne
I found that if you use the old APIs the notification will not disappear.
I used pre-iOS 10 API and it worked.
let notification = UILocalNotification()
notification.fireDate = Date().addingTimeInterval(10) // post after 10 seconds
if #available(iOS 8.2, *) {
notification.alertTitle = "Title"
}
notification.alertBody = "Your message"
notification.soundName = UILocalNotificationDefaultSoundName
UIApplication.shared.scheduleLocalNotification(notification)
Tested this on iOS 12.1 and the notification did not disappear. If I were to use UNMutableNotificationContent
the notification would disappear.
No. You could schedule a bunch of notifications but that's different. There is no way to listen to when the notification is dismissed, keep it on the screen, or do anything that changes it's performance as it's all handled outside of your app.