Skip to content

Suppress silent passive notifications in willPresent handler#655

Open
bjorkert wants to merge 1 commit into
devfrom
fix-willpresent-only
Open

Suppress silent passive notifications in willPresent handler#655
bjorkert wants to merge 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.
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.

1 participant