diff --git a/Signal/src/UserInterface/Notifications/UserNotificationsAdaptee.swift b/Signal/src/UserInterface/Notifications/UserNotificationsAdaptee.swift index 50aab570fb..9bccb2ace0 100644 --- a/Signal/src/UserInterface/Notifications/UserNotificationsAdaptee.swift +++ b/Signal/src/UserInterface/Notifications/UserNotificationsAdaptee.swift @@ -180,9 +180,13 @@ extension UserNotificationPresenterAdaptee: NotificationPresenterAdaptee { func clearAllNotifications() { AssertIsOnMainThread() + notificationCenter.removeAllPendingNotificationRequests() notificationCenter.removeAllDeliveredNotifications() - LegacyNotificationPresenterAdaptee.clearExistingNotifications() + + if !FeatureFlags.onlyModernNotificationClearance { + LegacyNotificationPresenterAdaptee.clearExistingNotifications() + } } func shouldPresentNotification(category: AppNotificationCategory, userInfo: [AnyHashable: Any]) -> Bool { diff --git a/SignalServiceKit/src/Util/FeatureFlags.swift b/SignalServiceKit/src/Util/FeatureFlags.swift index 724d5e19bb..d985560dd6 100644 --- a/SignalServiceKit/src/Util/FeatureFlags.swift +++ b/SignalServiceKit/src/Util/FeatureFlags.swift @@ -72,7 +72,13 @@ public class FeatureFlags: NSObject { @objc public static let strictSyncTranscriptTimestamps = false + private static let isPrivateBeta = false + // Don't enable this flag in production. @objc - public static let strictYDBExtensions = false + public static let strictYDBExtensions = isPrivateBeta + + // Don't enable this flag in production. + @objc + public static let onlyModernNotificationClearance = isPrivateBeta }