Add onlyModernNotificationClearance feature flag.

This commit is contained in:
Matthew Chen 2019-06-21 16:00:43 -04:00
parent d380d3fc1a
commit 11b7879d78
2 changed files with 12 additions and 2 deletions

View File

@ -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 {

View File

@ -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
}