-
Notifications
You must be signed in to change notification settings - Fork 21
How to prevent expired notification from displaying
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.
If you have any questions or suggestions, feel free to send an email to support@infobip.com or create an issue.