We make a messaging and calling app (Call.com). When a user reads a chat on another device (web or another phone), we want that chat's notifications removed from their iPhone's lock screen and Notification Center.
Our plan is a Notification Service Extension that receives a "message read" push, removes the matching delivered notifications with removeDeliveredNotifications(withIdentifiers:), and then hides the read push itself by passing an empty UNNotificationContent to the content handler. The read push carries only a conversation ID and a message ID, with no message content. Hiding it needs com.apple.developer.usernotifications.filtering.
The entitlement request form offers four use cases. The closest is end-to-end encrypted messaging, but it doesn't apply to us: our server can read notification content. So we don't think we should select it.
We tried a background push (content-available: 1, sent through FCM) first. We tested on a physical iPhone with Background App Refresh on and the app running in the background (not force-quit). The device log showed the push being deferred: a com.apple.pushLaunch.<bundleId> activity was submitted with a 24-hour window. A second background push sent about 190 ms later cancelled that pending activity. The app never ran, and the notification stayed on the lock screen for the 8 minutes we watched.
Questions:
- Can the filtering entitlement be granted for this use case, or only for the four listed ones?
- If not, what is the recommended way to remove delivered notifications after the user reads them on another device? Is a background push the only supported option?
- If a background push is the answer, what can we do to make it more reliable? For example, would sending one background push per read event instead of two help?
Thanks!