From 04106bf2f0523e96b84aea56b267748869e90646 Mon Sep 17 00:00:00 2001 From: Sam Symons Date: Mon, 3 Jun 2024 06:27:18 -0700 Subject: [PATCH] Additional Privacy Pro RMF changes (#2911) Task/Issue URL: https://app.asana.com/0/414235014887631/1207409447873013/f Tech Design URL: CC: Description: This PR adds support for new RMF attributes and placeholder image for Privacy Pro. --- DuckDuckGo.xcodeproj/project.pbxproj | 2 +- .../xcshareddata/swiftpm/Package.resolved | 4 ++-- .../Contents.json | 5 ++++- .../RemoteMessagePrivacyPro.pdf | Bin 0 -> 14556 bytes .../RemoteMessageVPNAnnounce.pdf | Bin 15349 -> 0 bytes DuckDuckGo/RemoteMessaging.swift | 18 +++++++++++++++++- .../RemoteMessagingStoreTests.swift | 4 +++- 7 files changed, 27 insertions(+), 6 deletions(-) rename DuckDuckGo/HomeMessage.xcassets/RemoteMessage/{RemoteMessageVPNAnnounce.imageset => RemoteMessagePrivacyPro.imageset}/Contents.json (50%) create mode 100644 DuckDuckGo/HomeMessage.xcassets/RemoteMessage/RemoteMessagePrivacyPro.imageset/RemoteMessagePrivacyPro.pdf delete mode 100644 DuckDuckGo/HomeMessage.xcassets/RemoteMessage/RemoteMessageVPNAnnounce.imageset/RemoteMessageVPNAnnounce.pdf diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index 9b62f03e26..a4655b86ae 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -9778,7 +9778,7 @@ repositoryURL = "https://github.com/DuckDuckGo/BrowserServicesKit"; requirement = { kind = exactVersion; - version = 149.0.0; + version = 150.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 82f656887d..ca2f0dca4b 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" : "cd7850dd115f4c896095f410c1049fc32bdf7b16", - "version" : "149.0.0" + "revision" : "03e6b719671c5baaa2afa474d447b707bf595820", + "version" : "150.0.0" } }, { diff --git a/DuckDuckGo/HomeMessage.xcassets/RemoteMessage/RemoteMessageVPNAnnounce.imageset/Contents.json b/DuckDuckGo/HomeMessage.xcassets/RemoteMessage/RemoteMessagePrivacyPro.imageset/Contents.json similarity index 50% rename from DuckDuckGo/HomeMessage.xcassets/RemoteMessage/RemoteMessageVPNAnnounce.imageset/Contents.json rename to DuckDuckGo/HomeMessage.xcassets/RemoteMessage/RemoteMessagePrivacyPro.imageset/Contents.json index cbe62e069c..04c63ce202 100644 --- a/DuckDuckGo/HomeMessage.xcassets/RemoteMessage/RemoteMessageVPNAnnounce.imageset/Contents.json +++ b/DuckDuckGo/HomeMessage.xcassets/RemoteMessage/RemoteMessagePrivacyPro.imageset/Contents.json @@ -1,12 +1,15 @@ { "images" : [ { - "filename" : "RemoteMessageVPNAnnounce.pdf", + "filename" : "RemoteMessagePrivacyPro.pdf", "idiom" : "universal" } ], "info" : { "author" : "xcode", "version" : 1 + }, + "properties" : { + "preserves-vector-representation" : true } } diff --git a/DuckDuckGo/HomeMessage.xcassets/RemoteMessage/RemoteMessagePrivacyPro.imageset/RemoteMessagePrivacyPro.pdf b/DuckDuckGo/HomeMessage.xcassets/RemoteMessage/RemoteMessagePrivacyPro.imageset/RemoteMessagePrivacyPro.pdf new file mode 100644 index 0000000000000000000000000000000000000000..18085b7a093a947728b9d5bf2e5100cac4e649b1 GIT binary patch literal 14556 zcmeI3U5_P4k%sTjuc#YKfaEioRayBVAxmHzv;wr=@!p}mXxfb#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{Kck;o6qm>sUcD>n!Wkr)&JZ@V)Xg$;pN+h SBE!6KT@OF|*=N7|)&Bw;x74u! diff --git a/DuckDuckGo/RemoteMessaging.swift b/DuckDuckGo/RemoteMessaging.swift index a7ebf8dc4b..494010a7ad 100644 --- a/DuckDuckGo/RemoteMessaging.swift +++ b/DuckDuckGo/RemoteMessaging.swift @@ -161,6 +161,20 @@ struct RemoteMessaging { let daysSinceNetworkProtectionEnabled = activationDateStore.daysSinceActivation() ?? -1 let surveyActionMapper = DefaultRemoteMessagingSurveyURLBuilder(statisticsStore: statisticsStore) + var privacyProDaysSinceSubscribed: Int = -1 + var privacyProDaysUntilExpiry: Int = -1 + + if let accessToken = AppDependencyProvider.shared.subscriptionManager.accountManager.accessToken { + let subscriptionResult = await AppDependencyProvider.shared.subscriptionManager.subscriptionService.getSubscription( + accessToken: accessToken + ) + + if case let .success(subscription) = subscriptionResult { + privacyProDaysSinceSubscribed = Calendar.current.numberOfDaysBetween(subscription.startedAt, and: Date()) ?? -1 + privacyProDaysUntilExpiry = Calendar.current.numberOfDaysBetween(Date(), and: subscription.expiresOrRenewsAt) ?? -1 + } + } + let remoteMessagingConfigMatcher = RemoteMessagingConfigMatcher( appAttributeMatcher: AppAttributeMatcher(statisticsStore: statisticsStore, variantManager: variantManager, @@ -173,7 +187,9 @@ struct RemoteMessaging { isWidgetInstalled: isWidgetInstalled, daysSinceNetPEnabled: daysSinceNetworkProtectionEnabled, isPrivacyProEligibleUser: canPurchase, - isPrivacyProSubscriber: isPrivacyProSubscriber), + isPrivacyProSubscriber: isPrivacyProSubscriber, + privacyProDaysSinceSubscribed: privacyProDaysSinceSubscribed, + privacyProDaysUntilExpiry: privacyProDaysUntilExpiry), percentileStore: RemoteMessagingPercentileUserDefaultsStore(userDefaults: .standard), surveyActionMapper: surveyActionMapper, dismissedMessageIds: remoteMessagingStore.fetchDismissedRemoteMessageIds() diff --git a/DuckDuckGoTests/RemoteMessagingStoreTests.swift b/DuckDuckGoTests/RemoteMessagingStoreTests.swift index 191ae48b11..ecf4c0edb7 100644 --- a/DuckDuckGoTests/RemoteMessagingStoreTests.swift +++ b/DuckDuckGoTests/RemoteMessagingStoreTests.swift @@ -143,7 +143,9 @@ class RemoteMessagingStoreTests: XCTestCase { isWidgetInstalled: false, daysSinceNetPEnabled: -1, isPrivacyProEligibleUser: false, - isPrivacyProSubscriber: false), + isPrivacyProSubscriber: false, + privacyProDaysSinceSubscribed: -1, + privacyProDaysUntilExpiry: -1), percentileStore: RemoteMessagingPercentileUserDefaultsStore(userDefaults: self.defaults), surveyActionMapper: MockRemoteMessagingSurveyActionMapper(), dismissedMessageIds: []