How to prevent expired notification from displaying - infobip/mobile-messaging-sdk-ios GitHub Wiki
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.