Skip to content

Commit

Permalink
Add RMF messageShown attribute (#3062)
Browse files Browse the repository at this point in the history
Task/Issue URL: https://app.asana.com/0/1199333091098016/1207959177057413/f
Tech Design URL:
CC:

Description:

This PR adds support for the RMF messageShown attribute.
  • Loading branch information
samsymons authored Aug 4, 2024
1 parent 9e399dc commit 149b303
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -13370,7 +13370,7 @@
repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit";
requirement = {
kind = exactVersion;
version = 178.0.0;
version = 179.0.0;
};
};
9FF521422BAA8FF300B9819B /* XCRemoteSwiftPackageReference "lottie-spm" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/duckduckgo/BrowserServicesKit",
"state" : {
"revision" : "ebad3db46e09913ac4c0e0c62085dcb40a6d6253",
"version" : "178.0.0"
"revision" : "dfddead0e1e4735a021d3affb05b64fea561a807",
"version" : "179.0.0"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ final class RemoteMessagingConfigMatcherProvider: RemoteMessagingConfigMatcherPr
}

let dismissedMessageIds = store.fetchDismissedRemoteMessageIDs()
let shownMessageIds = store.fetchShownRemoteMessageIDs()

#if APPSTORE
let isInstalledMacAppStore = true
Expand Down Expand Up @@ -155,6 +156,7 @@ final class RemoteMessagingConfigMatcherProvider: RemoteMessagingConfigMatcherPr
isPrivacyProSubscriptionExpiring: isPrivacyProSubscriptionExpiring,
isPrivacyProSubscriptionExpired: isPrivacyProSubscriptionExpired,
dismissedMessageIds: dismissedMessageIds,
shownMessageIds: shownMessageIds,
pinnedTabsCount: pinnedTabsManager.tabCollection.tabs.count,
hasCustomHomePage: startupPreferencesPersistor().launchToCustomHomePage,
isDuckPlayerOnboarded: duckPlayerPreferencesPersistor.youtubeOverlayAnyButtonPressed,
Expand Down
2 changes: 1 addition & 1 deletion LocalPackages/DataBrokerProtection/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ let package = Package(
targets: ["DataBrokerProtection"])
],
dependencies: [
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "178.0.0"),
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "179.0.0"),
.package(path: "../SwiftUIExtensions"),
.package(path: "../XPCHelper"),
],
Expand Down
2 changes: 1 addition & 1 deletion LocalPackages/NetworkProtectionMac/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ let package = Package(
.library(name: "VPNAppLauncher", targets: ["VPNAppLauncher"]),
],
dependencies: [
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "178.0.0"),
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "179.0.0"),
.package(url: "https://github.com/airbnb/lottie-spm", exact: "4.4.3"),
.package(path: "../AppLauncher"),
.package(path: "../UDSHelper"),
Expand Down
2 changes: 1 addition & 1 deletion LocalPackages/SubscriptionUI/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ let package = Package(
targets: ["SubscriptionUI"]),
],
dependencies: [
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "178.0.0"),
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "179.0.0"),
.package(path: "../SwiftUIExtensions")
],
targets: [
Expand Down
6 changes: 6 additions & 0 deletions UnitTests/RemoteMessaging/MockRemoteMessagingStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class MockRemoteMessagingStore: RemoteMessagingStoring {
var fetchScheduledRemoteMessageCalls = 0
var fetchRemoteMessageCalls = 0
var hasShownRemoteMessageCalls = 0
var fetchShownRemoteMessageIdsCalls = 0
var hasDismissedRemoteMessageCalls = 0
var dismissRemoteMessageCalls = 0
var fetchDismissedRemoteMessageIdsCalls = 0
Expand Down Expand Up @@ -74,6 +75,11 @@ class MockRemoteMessagingStore: RemoteMessagingStoring {
return shownRemoteMessagesIDs.contains(id)
}

func fetchShownRemoteMessageIDs() -> [String] {
fetchShownRemoteMessageIdsCalls += 1
return shownRemoteMessagesIDs
}

func hasDismissedRemoteMessage(withID id: String) -> Bool {
hasDismissedRemoteMessageCalls += 1
return dismissedRemoteMessagesIDs.contains(id)
Expand Down

0 comments on commit 149b303

Please sign in to comment.