|
@@ -356,11 +356,13 @@ private final class PremiumPlansViewController: NSViewController {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /// Shown until StoreKit returns localized `Product.displayPrice` (never use hardcoded currency amounts).
|
|
|
|
|
+ private static let unloadedPricePlaceholder = "—"
|
|
|
|
|
+
|
|
|
private struct Plan {
|
|
private struct Plan {
|
|
|
let id: String
|
|
let id: String
|
|
|
let title: String
|
|
let title: String
|
|
|
let subtitle: String
|
|
let subtitle: String
|
|
|
- let price: String
|
|
|
|
|
let period: String
|
|
let period: String
|
|
|
let billedPill: String
|
|
let billedPill: String
|
|
|
let billedLine: String
|
|
let billedLine: String
|
|
@@ -405,7 +407,6 @@ private final class PremiumPlansViewController: NSViewController {
|
|
|
id: "weekly",
|
|
id: "weekly",
|
|
|
title: "Weekly",
|
|
title: "Weekly",
|
|
|
subtitle: "Flexible and commitment-free",
|
|
subtitle: "Flexible and commitment-free",
|
|
|
- price: "$9.99",
|
|
|
|
|
period: "/ week",
|
|
period: "/ week",
|
|
|
billedPill: "",
|
|
billedPill: "",
|
|
|
billedLine: "",
|
|
billedLine: "",
|
|
@@ -424,7 +425,6 @@ private final class PremiumPlansViewController: NSViewController {
|
|
|
id: "monthly",
|
|
id: "monthly",
|
|
|
title: "Monthly",
|
|
title: "Monthly",
|
|
|
subtitle: "Balanced for regular productivity",
|
|
subtitle: "Balanced for regular productivity",
|
|
|
- price: "$19.99",
|
|
|
|
|
period: "/ month",
|
|
period: "/ month",
|
|
|
billedPill: "",
|
|
billedPill: "",
|
|
|
billedLine: "",
|
|
billedLine: "",
|
|
@@ -443,7 +443,6 @@ private final class PremiumPlansViewController: NSViewController {
|
|
|
id: "yearly",
|
|
id: "yearly",
|
|
|
title: "Yearly",
|
|
title: "Yearly",
|
|
|
subtitle: "Best value for long-term users",
|
|
subtitle: "Best value for long-term users",
|
|
|
- price: "$39.99",
|
|
|
|
|
period: "/ year",
|
|
period: "/ year",
|
|
|
billedPill: "3 days free trial",
|
|
billedPill: "3 days free trial",
|
|
|
billedLine: "",
|
|
billedLine: "",
|
|
@@ -603,7 +602,7 @@ private final class PremiumPlansViewController: NSViewController {
|
|
|
topRightTag.isHidden = plan.billedPill.isEmpty
|
|
topRightTag.isHidden = plan.billedPill.isEmpty
|
|
|
topRightTag.font = .systemFont(ofSize: 10, weight: .bold)
|
|
topRightTag.font = .systemFont(ofSize: 10, weight: .bold)
|
|
|
|
|
|
|
|
- let priceLabel = NSTextField(labelWithString: plan.price)
|
|
|
|
|
|
|
+ let priceLabel = NSTextField(labelWithString: Self.unloadedPricePlaceholder)
|
|
|
priceLabel.font = .systemFont(ofSize: 18, weight: .semibold)
|
|
priceLabel.font = .systemFont(ofSize: 18, weight: .semibold)
|
|
|
priceLabel.textColor = Theme.primaryText
|
|
priceLabel.textColor = Theme.primaryText
|
|
|
|
|
|
|
@@ -931,8 +930,11 @@ private final class PremiumPlansViewController: NSViewController {
|
|
|
|
|
|
|
|
private func applyStorePricing() {
|
|
private func applyStorePricing() {
|
|
|
for plan in plans {
|
|
for plan in plans {
|
|
|
- guard let fields = planPriceFields[plan.id],
|
|
|
|
|
- let product = subscriptionStore.product(forPlanKey: plan.id) else { continue }
|
|
|
|
|
|
|
+ guard let fields = planPriceFields[plan.id] else { continue }
|
|
|
|
|
+ guard let product = subscriptionStore.product(forPlanKey: plan.id) else {
|
|
|
|
|
+ fields.price.stringValue = Self.unloadedPricePlaceholder
|
|
|
|
|
+ continue
|
|
|
|
|
+ }
|
|
|
fields.price.stringValue = product.displayPrice
|
|
fields.price.stringValue = product.displayPrice
|
|
|
if let period = product.subscription?.subscriptionPeriod {
|
|
if let period = product.subscription?.subscriptionPeriod {
|
|
|
fields.period.stringValue = periodSuffix(for: period)
|
|
fields.period.stringValue = periodSuffix(for: period)
|