Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

323
Views
Is there any way to remove delivered notifications upon arrival of a new one?

Roughly during the third quarter of last year, I was able to use UNNotificationServiceExtension to not only decrypt incoming push notification contents (a common use case) but also remove previously delivered notifications every time a new one arrived.

I used UNUserNotificationCenter.current().getDeliveredNotifications to retrieve delivered notifications and then remove those I needed to remove.

However, as the new year rolled up, I suddenly noticed that my app was no longer removing previously delivered notifications from the notification center, despite the code still being present in the service extension and not throwing any errors, and despite the other code in the service extension working just fine.

Upon debugging, I found that UNUserNotificationCenter.current().getDeliveredNotifications now returns an empty array of notifications even when there are several delivered on the lock screen.

And UNUserNotificationCenter.current().removeAllDeliveredNotifications() simply does nothing, so even just using that call, without retrieving or filtering delivered notifications, doesn't remove anything.

Does anyone know if there's still a way to accomplish this?

Or could Apple have prohibited this functionality?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

It seems apns-collapse-id APNs request header might be useful here.

  1. It could be used to update former notification content and bring it to the top.

    Multiple notifications with the same collapse identifier are displayed to the user as a single notification.

  2. According to the docs, apns-collapse-id specifies notification identifier (which normally is random). BE could send a new "delete" notification with the given id in the payload to use it in removeDeliveredNotifications(withIdentifiers:) function.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!