diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index 8d1928e32d..620d9d07d2 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -9826,7 +9826,7 @@ repositoryURL = "https://github.com/DuckDuckGo/BrowserServicesKit"; requirement = { kind = exactVersion; - version = 144.0.7; + version = 145.0.0; }; }; 9F8FE9472BAE50E50071E372 /* XCRemoteSwiftPackageReference "lottie-spm" */ = { diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 3ba862c09d..29b7f94f4c 100644 --- a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -32,8 +32,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/DuckDuckGo/BrowserServicesKit", "state" : { - "revision" : "c1ce2cb5015890868bac3be85fbac3794ab30cb4", - "version" : "144.0.7" + "revision" : "6568d48c381042275c1936c6301a5100dea1c278", + "version" : "145.0.0" } }, { @@ -138,7 +138,7 @@ { "identity" : "swift-argument-parser", "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-argument-parser.git", + "location" : "https://github.com/apple/swift-argument-parser", "state" : { "revision" : "46989693916f56d1186bd59ac15124caef896560", "version" : "1.3.1" diff --git a/DuckDuckGo/RemoteMessaging.swift b/DuckDuckGo/RemoteMessaging.swift index 942181c690..a0dd506002 100644 --- a/DuckDuckGo/RemoteMessaging.swift +++ b/DuckDuckGo/RemoteMessaging.swift @@ -181,6 +181,7 @@ struct RemoteMessaging { isWidgetInstalled: isWidgetInstalled, isNetPWaitlistUser: isNetworkProtectionWaitlistUser, daysSinceNetPEnabled: daysSinceNetworkProtectionEnabled), + percentileStore: RemoteMessagingPercentileUserDefaultsStore(userDefaults: .standard), dismissedMessageIds: remoteMessagingStore.fetchDismissedRemoteMessageIds() ) diff --git a/DuckDuckGoTests/RemoteMessagingStoreTests.swift b/DuckDuckGoTests/RemoteMessagingStoreTests.swift index 512e1d4b76..02e052c72b 100644 --- a/DuckDuckGoTests/RemoteMessagingStoreTests.swift +++ b/DuckDuckGoTests/RemoteMessagingStoreTests.swift @@ -27,17 +27,21 @@ import CoreData class RemoteMessagingStoreTests: XCTestCase { - private var data = JsonTestDataLoader() + static let userDefaultsSuiteName = "remote-messaging-store-tests" + private var data = JsonTestDataLoader() private var store: RemoteMessagingStore! - private let notificationCenter = NotificationCenter() + private var defaults: UserDefaults! override func setUpWithError() throws { try super.setUpWithError() let container = CoreData.remoteMessagingContainer() let context = container.viewContext store = RemoteMessagingStore(context: context, notificationCenter: notificationCenter) + + defaults = UserDefaults(suiteName: Self.userDefaultsSuiteName)! + defaults.removePersistentDomain(forName: Self.userDefaultsSuiteName) } override func tearDownWithError() throws { @@ -139,6 +143,7 @@ class RemoteMessagingStoreTests: XCTestCase { isWidgetInstalled: false, isNetPWaitlistUser: false, daysSinceNetPEnabled: -1), + percentileStore: RemoteMessagingPercentileUserDefaultsStore(userDefaults: self.defaults), dismissedMessageIds: [] )