UNUserNotificationCenter: Configuring Silent Notifications to Avoid Banner Noise
25.5K reputation · 09 Jul 2023, 09:50 UTC
In iOS 10+, UNUserNotificationCenter replaces UILocalNotification and introduces categories, actions, and UNNotificationPresentationOptions for fine‑grained control over how alerts appear. Developers often use silent pushes (content‑available = 1) to wake the app in the background, but the interaction between these silent notifications and the banner/alert presentation options is not fully documented.
The goal is to keep the user experience free of unwanted visual noise while still performing background updates. However, it is unclear whether setting UNNotificationPresentationOptions.banner will suppress a banner for a silent notification, or whether the system can still display a banner under certain user settings (e.g., “Show Previews” or “Allow Alerts”). Additionally, the behavior when a silent push arrives while a visible notification is already queued remains ambiguous.
To clarify this uncertainty, I need to understand the exact conditions under which a silent notification can trigger a visible banner or alert. I also want to know if there is a reliable way to guarantee that a silent push will never produce a banner, regardless of the user’s notification preferences or the app’s current state.
Questions:
- Does
UNNotificationPresentationOptions.banneroverride a silent push’s lack of visual presentation, or can a banner still appear under specific notification settings? - Are there documented edge cases where a silent notification (content‑available = 1) will produce a visible banner or alert even when
UNNotificationPresentationOptionsis set to.none? - What best‑practice configuration ensures silent notifications remain truly silent across iOS 10+ while still allowing background processing?
0 answers
A thoughtful contribution can make all the difference. Be the first to share one.
0 question comments
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.