diff --git a/Cryptomator/MainCoordinator.swift b/Cryptomator/MainCoordinator.swift index 4d39c8fc3..d6fae1af4 100644 --- a/Cryptomator/MainCoordinator.swift +++ b/Cryptomator/MainCoordinator.swift @@ -124,7 +124,7 @@ extension MainCoordinator: StoreObserverDelegate { case .fullVersion, .yearlySubscription: showFullVersionAlert() // Temporarily added for December 2024 Sale - NotificationCenter.default.post(name: .dismissBannerNotification, object: nil) + NotificationCenter.default.post(name: .purchasedFullVersionNotification, object: nil) case let .freeTrial(expiresOn): showTrialAlert(expirationDate: expiresOn) case .unknown: diff --git a/Cryptomator/Purchase/PurchaseCoordinator.swift b/Cryptomator/Purchase/PurchaseCoordinator.swift index b386b1a6b..34953f113 100644 --- a/Cryptomator/Purchase/PurchaseCoordinator.swift +++ b/Cryptomator/Purchase/PurchaseCoordinator.swift @@ -52,7 +52,7 @@ class PurchaseCoordinator: Coordinator { self.unlockedPro() } // Temporarily added for December 2024 Sale - NotificationCenter.default.post(name: .dismissBannerNotification, object: nil) + NotificationCenter.default.post(name: .purchasedFullVersionNotification, object: nil) } func handleRestoreResult(_ result: RestoreTransactionsResult) { diff --git a/Cryptomator/Purchase/PurchaseViewModel.swift b/Cryptomator/Purchase/PurchaseViewModel.swift index 1659d77bd..99365aee4 100644 --- a/Cryptomator/Purchase/PurchaseViewModel.swift +++ b/Cryptomator/Purchase/PurchaseViewModel.swift @@ -39,10 +39,13 @@ class PurchaseViewModel: BaseIAPViewModel, ProductFetching { let currentMonth = Calendar.current.component(.month, from: Date()) // TODO: Change `currentMonth == 11` to `12` if currentYear == 2024 && currentMonth == 11 { - return .textWithLeadingSystemImage("info.circle.fill", - text: LocalizedString.getValue("purchase.discount"), - font: .preferredFont(forTextStyle: .body), - color: .secondaryLabel) + return NSAttributedString( + string: "*Note: The discount amount may vary by region.", + attributes: [ + .font: UIFont.preferredFont(forTextStyle: .footnote), + .foregroundColor: UIColor.secondaryLabel + ] + ) } else { return nil } @@ -92,7 +95,7 @@ class PurchaseViewModel: BaseIAPViewModel, ProductFetching { private func addLifetimeLicenseItem() { if let product = products[.fullVersion], let localizedPrice = product.localizedPrice { let viewModel = PurchaseCellViewModel(productName: LocalizedString.getValue("purchase.product.lifetimeLicense"), - productDetail: LocalizedString.getValue("purchase.product.lifetimeLicense.detail"), + productDetail: "🎁 33%* off in December", price: localizedPrice, purchaseDetail: LocalizedString.getValue("purchase.product.lifetimeLicense.duration"), productIdentifier: .fullVersion) diff --git a/Cryptomator/VaultList/VaultListViewController.swift b/Cryptomator/VaultList/VaultListViewController.swift index d29d07bb6..6daa47166 100644 --- a/Cryptomator/VaultList/VaultListViewController.swift +++ b/Cryptomator/VaultList/VaultListViewController.swift @@ -57,7 +57,7 @@ class VaultListViewController: ListViewController { } #if !ALWAYS_PREMIUM - fullVersionPurchasedObserver = NotificationCenter.default.addObserver(forName: .dismissBannerNotification, object: nil, queue: .main) { [weak self] _ in + fullVersionPurchasedObserver = NotificationCenter.default.addObserver(forName: .purchasedFullVersionNotification, object: nil, queue: .main) { [weak self] _ in self?.dismissBanner() } checkAndShowBanner() @@ -148,7 +148,7 @@ class VaultListViewController: ListViewController { emojiLabel.setContentCompressionResistancePriority(.required, for: .horizontal) let textLabel = UILabel() - textLabel.text = LocalizedString.getValue("purchase.discount") + textLabel.text = "Lifetime License is 33%* off in December!" textLabel.textColor = .white textLabel.font = UIFont.preferredFont(forTextStyle: .body) textLabel.adjustsFontSizeToFitWidth = true @@ -185,7 +185,7 @@ class VaultListViewController: ListViewController { NSLayoutConstraint.activate([ banner.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 16), banner.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -16), - banner.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor), + banner.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor, constant: -16), banner.centerXAnchor.constraint(equalTo: view.centerXAnchor), banner.heightAnchor.constraint(equalToConstant: 60) ]) @@ -210,5 +210,5 @@ class VaultListViewController: ListViewController { } extension Notification.Name { - static let dismissBannerNotification = Notification.Name("DismissBannerNotification") + static let purchasedFullVersionNotification = Notification.Name("PurchasedFullVersionNotification") } diff --git a/CryptomatorTests/Purchase/PurchaseViewModelTests.swift b/CryptomatorTests/Purchase/PurchaseViewModelTests.swift index 20a57547c..d3e07bc8e 100644 --- a/CryptomatorTests/Purchase/PurchaseViewModelTests.swift +++ b/CryptomatorTests/Purchase/PurchaseViewModelTests.swift @@ -169,7 +169,7 @@ class PurchaseViewModelTests: IAPViewModelTestCase { private var lifetimeLicenseCell: Item { return .purchaseCell(.init(productName: LocalizedString.getValue("purchase.product.lifetimeLicense"), - productDetail: nil, + productDetail: "🎁 33%* off in December", price: "$11.99", purchaseDetail: LocalizedString.getValue("purchase.product.lifetimeLicense.duration"), productIdentifier: .fullVersion)) diff --git a/SharedResources/en.lproj/Localizable.strings b/SharedResources/en.lproj/Localizable.strings index a71d9a062..6445a8fd8 100644 --- a/SharedResources/en.lproj/Localizable.strings +++ b/SharedResources/en.lproj/Localizable.strings @@ -162,7 +162,6 @@ "onboarding.button.continue" = "Continue"; "purchase.beginFreeTrial.alert.title" = "Trial Unlocked"; -"purchase.discount" = "Lifetime License is 33% off in December!"; "purchase.expiredTrial" = "Your trial has expired."; "purchase.footer.privacyPolicy" = "Privacy Policy"; "purchase.footer.termsOfUse" = "Terms of Use"; @@ -172,7 +171,6 @@ "purchase.product.donateAndUpgrade" = "Donate & Upgrade"; "purchase.product.freeUpgrade" = "Free Upgrade"; "purchase.product.lifetimeLicense" = "Lifetime License"; -"purchase.product.lifetimeLicense.detail" = "🎁 33% off in December"; "purchase.product.lifetimeLicense.duration" = "one-time"; "purchase.product.pricing.free" = "Free"; "purchase.product.trial" = "30-Day Trial";