Skip to content

Suppress silent passive notifications in willPresent handler#655

Merged
marionbarker merged 1 commit into
devfrom
fix-willpresent-only
Jun 14, 2026
Merged

Suppress silent passive notifications in willPresent handler#655
marionbarker merged 1 commit into
devfrom
fix-willpresent-only

Conversation

@bjorkert

Copy link
Copy Markdown
Member

Summary

UNUserNotificationCenterDelegate.willPresent in AppDelegate returned
[.banner, .sound, .badge] unconditionally, so any notification iOS
routed 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

  • Return [] for passive notifications and for notifications with
    empty title/body.
  • The four intentional alerts (scheduleRenewalFailed…,
    scheduleApnsCredentialsMissing…, schedulePushToStartTokenMissing…,
    alarms) all use non-empty title/body and the default .active
    interruption level, so they continue to surface as banners.
  • Expanded the willPresent log line with interruptionLevel and
    whether 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).

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.

@codebymini codebymini left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@marionbarker marionbarker left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@marionbarker marionbarker merged commit 3f9b6cd into dev Jun 14, 2026
1 check passed
@marionbarker marionbarker deleted the fix-willpresent-only branch June 14, 2026 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants