Skip to content

Commit

Permalink
Work on final touches
Browse files Browse the repository at this point in the history
  • Loading branch information
samsymons committed Nov 27, 2023
1 parent cd15b5c commit 3d1a465
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 19 deletions.
2 changes: 2 additions & 0 deletions DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1311,6 +1311,7 @@
4B470EDE299C67270086EBDC /* AppTrackerEntity.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppTrackerEntity.swift; sourceTree = "<group>"; };
4B470EE2299C6DD10086EBDC /* AppTrackingProtectionStoringModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppTrackingProtectionStoringModel.swift; sourceTree = "<group>"; };
4B52648A25F9613B00CB4C24 /* trackerData.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = trackerData.json; sourceTree = "<group>"; };
4B5293BC2B14DA4C007860EB /* BrowserServicesKit */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = BrowserServicesKit; path = ../BrowserServicesKit; sourceTree = "<group>"; };
4B53648926718D0E001AA041 /* EmailWaitlist.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmailWaitlist.swift; sourceTree = "<group>"; };
4B5C46292AF2A6E6002A4432 /* VPNIntents.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPNIntents.swift; sourceTree = "<group>"; };
4B60AC96252EC07B00E8D219 /* fullscreenvideo.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = fullscreenvideo.js; sourceTree = "<group>"; };
Expand Down Expand Up @@ -3639,6 +3640,7 @@
84E341891E2F7EFB00BDBA6F = {
isa = PBXGroup;
children = (
4B5293BC2B14DA4C007860EB /* BrowserServicesKit */,
EE3B98EB2A963515002F63A0 /* WidgetsExtensionAlpha.entitlements */,
6FB030C7234331B400A10DB9 /* Configuration.xcconfig */,
EEB8FDB92A990AEE00EBEDCF /* Configuration-Alpha.xcconfig */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,6 @@
"version": "3.0.0"
}
},
{
"package": "BrowserServicesKit",
"repositoryURL": "https://github.com/DuckDuckGo/BrowserServicesKit",
"state": {
"branch": null,
"revision": "820203512819e81c4dd5ff0b53711d0010a8253c",
"version": "85.1.0"
}
},
{
"package": "CocoaAsyncSocket",
"repositoryURL": "https://github.com/robbiehanson/CocoaAsyncSocket",
Expand Down
34 changes: 24 additions & 10 deletions DuckDuckGo/RemoteMessaging.swift
Original file line number Diff line number Diff line change
Expand Up @@ -149,17 +149,31 @@ struct RemoteMessaging {
case .success(let statusResponse):
os_log("Successfully fetched remote messages", log: .remoteMessaging, type: .debug)

let isNetworkProtectionWaitlistUser: Bool
let daysSinceNetworkProtectionEnabled: Int

#if NETWORK_PROTECTION
// TODO: Use real values
isNetworkProtectionWaitlistUser = true
daysSinceNetworkProtectionEnabled = 5
#else
isNetworkProtectionWaitlistUser = false
daysSinceNetworkProtectionEnabled = 0
#endif

let remoteMessagingConfigMatcher = RemoteMessagingConfigMatcher(
appAttributeMatcher: AppAttributeMatcher(statisticsStore: statisticsStore,
variantManager: variantManager,
isInternalUser: AppDependencyProvider.shared.internalUserDecider.isInternalUser),
userAttributeMatcher: UserAttributeMatcher(statisticsStore: statisticsStore,
variantManager: variantManager,
bookmarksCount: bookmarksCount,
favoritesCount: favoritesCount,
appTheme: AppUserDefaults().currentThemeName.rawValue,
isWidgetInstalled: isWidgetInstalled),
dismissedMessageIds: remoteMessagingStore.fetchDismissedRemoteMessageIds()
appAttributeMatcher: AppAttributeMatcher(statisticsStore: statisticsStore,
variantManager: variantManager,
isInternalUser: AppDependencyProvider.shared.internalUserDecider.isInternalUser),
userAttributeMatcher: UserAttributeMatcher(statisticsStore: statisticsStore,
variantManager: variantManager,
bookmarksCount: bookmarksCount,
favoritesCount: favoritesCount,
appTheme: AppUserDefaults().currentThemeName.rawValue,
isWidgetInstalled: isWidgetInstalled,
isNetPWaitlistUser: isNetworkProtectionWaitlistUser,
daysSinceNetPEnabled: daysSinceNetworkProtectionEnabled),
dismissedMessageIds: remoteMessagingStore.fetchDismissedRemoteMessageIds()
)

let processor = RemoteMessagingConfigProcessor(remoteMessagingConfigMatcher: remoteMessagingConfigMatcher)
Expand Down

0 comments on commit 3d1a465

Please sign in to comment.