Suppress silent passive notifications in willPresent handler#655
Merged
Conversation
UNUserNotificationCenterDelegate.willPresent returned [.banner, .sound, .badge] unconditionally, which meant any notification iOS routed through this handler while the app was foregrounded produced sound — including the Live Activity push-to-start payload, which is intentionally silent (interruption-level: passive, empty title/body). Now returns [] for passive notifications and for ones with empty title/body. The four intentional alerts (renewal-failed, APNs credentials missing, push-to-start token missing, alarms) all use non-empty title/body and the default .active interruption level, so they continue to surface. Also expanded the willPresent log line with interruptionLevel and title/body presence so future reports can confirm whether iOS routed a given payload here.
bjorkert
added a commit
that referenced
this pull request
May 12, 2026
marionbarker
approved these changes
Jun 14, 2026
marionbarker
left a comment
Collaborator
There was a problem hiding this comment.
I had some trouble building this because it came after we merged #608 into dev, but does not include 608 in this branch. Did the trick figured out during 608 testing to build successfully. (get blank screen, quit and restart app).
Approve by code review and test.
- Test for Loop URL
- Test for Trio URL
- Test for iOS 18.7.8 and iOS 26.5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
UNUserNotificationCenterDelegate.willPresentinAppDelegatereturned[.banner, .sound, .badge]unconditionally, so any notification iOSrouted through the handler while the app was foregrounded produced
sound — including the Live Activity push-to-start payload, which is
intentionally silent (
interruption-level: passive, empty title/body).6.1.0 users reported the silent renewal triggering an audible banner.
Change
[]for passive notifications and for notifications withempty title/body.
scheduleRenewalFailed…,scheduleApnsCredentialsMissing…,schedulePushToStartTokenMissing…,alarms) all use non-empty title/body and the default
.activeinterruption level, so they continue to surface as banners.
willPresentlog line withinterruptionLevelandwhether title/body are empty so future reports can confirm whether iOS
is routing a given payload through this handler.
Replaces #638 (split into three independently reviewable PRs).