I am growing an iOS app that receives broadcast push notifications. For sure person preferences, I have to silently seize the payload (for instance, to insert knowledge right into a database) with out displaying any notification UI to the person.
Initially, I tried to make use of the com.apple.developer.usernotifications.filtering entitlement to intercept and conceal notifications. Nonetheless, Apple didn’t approve this entitlement, and as a substitute, they suggest utilizing background fetch or background processing. The problem with these options is that—since our push messages are broadcast—the ensuing server calls for each message might create vital visitors and cargo on our servers.
To summarize, my necessities are:
Silently course of push notifications: The payload ought to be captured and dealt with with none alert, banner, or sound, no matter whether or not the app is working, within the background, or terminated.
Keep away from extreme server load: I would like a mechanism that doesn’t pressure a server name for each broadcast message.
I’ve additionally experimented with configuring silent push notifications utilizing the content-available flag as proven under:
{
"aps": {
"content-available": 1,
"alert": "",
"sound": ""
},
"customData": {
// extra payload knowledge
}
}
Whereas silent pushes (with content-available: 1) work in some instances, their supply is just not assured when the app is terminated, and iOS could throttle these pushes based mostly on system situations.
My questions are:
1. Is there any formally supported technique or workaround that permits intercepting and suppressing the UI for push notifications (i.e., “hiding” them) in order that the payload will be processed silently—even when the app is within the background or terminated?
2. If not, what are the really useful finest practices for dealing with such a state of affairs whereas minimizing server load for broadcast notifications?
Any insights, different design patterns, or workarounds that may assist obtain this performance can be drastically appreciated.