diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index d20e8a04c7..adf7e453d4 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -9900,7 +9900,7 @@ repositoryURL = "https://github.com/DuckDuckGo/BrowserServicesKit"; requirement = { kind = exactVersion; - version = 108.1.0; + version = 109.0.0; }; }; C14882EB27F211A000D59F0C /* XCRemoteSwiftPackageReference "SwiftSoup" */ = { diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 4db92a9200..b6945916ac 100644 --- a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -14,8 +14,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/DuckDuckGo/BrowserServicesKit", "state" : { - "revision" : "ab03bde3e1817b267debe9858a08b3f0caf72dc3", - "version" : "108.1.0" + "revision" : "5ecf4fe56f334be6eaecb65f6d55632a6d53921c", + "version" : "109.0.0" } }, { @@ -156,7 +156,7 @@ { "identity" : "trackerradarkit", "kind" : "remoteSourceControl", - "location" : "https://github.com/duckduckgo/TrackerRadarKit", + "location" : "https://github.com/duckduckgo/TrackerRadarKit.git", "state" : { "revision" : "a6b7ba151d9dc6684484f3785293875ec01cc1ff", "version" : "1.2.2" diff --git a/DuckDuckGo/SettingsViewModel.swift b/DuckDuckGo/SettingsViewModel.swift index 0e79e5475e..2d937f2d9d 100644 --- a/DuckDuckGo/SettingsViewModel.swift +++ b/DuckDuckGo/SettingsViewModel.swift @@ -75,9 +75,6 @@ final class SettingsViewModel: ObservableObject { @Published var shouldNavigateToDBP = false @Published var shouldNavigateToITP = false - // Subscription Entitlement names: TBD - static let entitlementNames = ["dummy1", "dummy2", "dummy3"] - // Our View State @Published private(set) var state: SettingsState @@ -342,8 +339,9 @@ extension SettingsViewModel { } // Check for valid entitlements - let hasEntitlements = await AccountManager().hasEntitlement(for: Self.entitlementNames.first!) - self.state.subscription.hasActiveSubscription = hasEntitlements ? true : false + if case let .success(entitlements) = await AccountManager().fetchEntitlements() { + self.state.subscription.hasActiveSubscription = !entitlements.isEmpty + } // Cache Subscription state Self.cachedHasActiveSubscription = self.state.subscription.hasActiveSubscription diff --git a/DuckDuckGo/SubscriptionDebugViewController.swift b/DuckDuckGo/SubscriptionDebugViewController.swift index 8e571649f7..feb61f2310 100644 --- a/DuckDuckGo/SubscriptionDebugViewController.swift +++ b/DuckDuckGo/SubscriptionDebugViewController.swift @@ -238,11 +238,13 @@ final class SubscriptionDebugViewController: UITableViewController { showAlert(title: "Not authenticated", message: "No authenticated user found! - Subscription not available") return } - for entitlementName in ["fake", "dummy1", "dummy2", "dummy3"] { - let result = await AccountManager().hasEntitlement(for: entitlementName) - let resultSummary = "Entitlement check for \(entitlementName): \(result)" - results.append(resultSummary) - print(resultSummary) + let entitlements: [AccountManager.Entitlement] = [.networkProtection, .dataBrokerProtection, .identityTheftRestoration] + for entitlement in entitlements { + if case let .success(result) = await AccountManager().hasEntitlement(for: entitlement) { + let resultSummary = "Entitlement check for \(entitlement.rawValue): \(result)" + results.append(resultSummary) + print(resultSummary) + } } showAlert(title: "Available Entitlements", message: results.joined(separator: "\n")) } diff --git a/LocalPackages/DuckUI/Package.swift b/LocalPackages/DuckUI/Package.swift index c74e599728..2ca38117ef 100644 --- a/LocalPackages/DuckUI/Package.swift +++ b/LocalPackages/DuckUI/Package.swift @@ -31,7 +31,7 @@ let package = Package( targets: ["DuckUI"]) ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "108.1.0"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "109.0.0"), ], targets: [ .target( diff --git a/LocalPackages/SyncUI/Package.swift b/LocalPackages/SyncUI/Package.swift index 7032a49924..ada2c28cc0 100644 --- a/LocalPackages/SyncUI/Package.swift +++ b/LocalPackages/SyncUI/Package.swift @@ -33,7 +33,7 @@ let package = Package( ], dependencies: [ .package(path: "../DuckUI"), - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "108.1.0"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "109.0.0"), .package(url: "https://github.com/duckduckgo/DesignResourcesKit", exact: "2.0.0") ], targets: [ diff --git a/LocalPackages/Waitlist/Package.swift b/LocalPackages/Waitlist/Package.swift index 9a9e0358d0..16cd15e42d 100644 --- a/LocalPackages/Waitlist/Package.swift +++ b/LocalPackages/Waitlist/Package.swift @@ -15,7 +15,7 @@ let package = Package( targets: ["Waitlist", "WaitlistMocks"]) ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "108.1.0"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "109.0.0"), .package(url: "https://github.com/duckduckgo/DesignResourcesKit", exact: "2.0.0") ], targets: [