Skip to content

How to prevent expired notification from displaying

Ivan Bilobrk edited this page Aug 20, 2025 · 1 revision

When sending push notifications with a validity period set, it may sometimes happen that the notification is still displayed even though it has expired. This is because APNs operates as a best-effort service and does not guarantee that notifications will not be delivered after the validity period has passed.

As a workaround, you can send silent push notifications as described in API documentation. Then, in the AppDelegate method didReceiveRemoteNotification, check if the notification is expired and, if so, prevent it from being displayed. An example implementation can be found in the Infobip Example app, within the AppDelegate.swift file.

Clone this wiki locally