Since iOS 10 and UNUserNotificationCenter
, a lot of things can be achieved with notifications, but I can't figure out how to remotely remove a push notification every time.
Using the mutable-content
attribute, I'm able to modify the content of my push notification.
But let's say I want to remove it later (the content has expired). I used content-available
and then the following code:
UNUserNotificationCenter.current()
.removeDeliveredNotifications(withIdentifiers: [xxx])
It almost works, except (and that's a major problem) when the app was swiped out of memory by the user.
Has anyone found a way to remove notifications?