Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

322
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda