|
@@ -4325,8 +4325,9 @@ class ViewController: NSViewController {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if let offer = product.subscription?.introductoryOffer, offer.paymentMode == .freeTrial {
|
|
|
|
|
- let trial = paywallSubscriptionPeriodDescription(offer.period)
|
|
|
|
|
|
|
+ if let offer = product.subscription?.introductoryOffer,
|
|
|
|
|
+ offer.paymentMode == .freeTrial,
|
|
|
|
|
+ let trial = paywallSubscriptionPeriodDescription(offer.period) {
|
|
|
let renewal = paywallSubscriptionPeriodDescription(product.subscription?.subscriptionPeriod)
|
|
let renewal = paywallSubscriptionPeriodDescription(product.subscription?.subscriptionPeriod)
|
|
|
if let renewal {
|
|
if let renewal {
|
|
|
return "Free for \(trial), then \(product.displayPrice)/\(renewal)"
|
|
return "Free for \(trial), then \(product.displayPrice)/\(renewal)"
|
|
@@ -4351,9 +4352,14 @@ class ViewController: NSViewController {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private func paywallHasFreeTrial(for plan: PremiumPlan) -> Bool {
|
|
|
|
|
- guard let product = storeKitCoordinator.productsByID[plan.rawValue] else { return false }
|
|
|
|
|
- return product.subscription?.introductoryOffer?.paymentMode == .freeTrial
|
|
|
|
|
|
|
+ private func paywallFreeTrialText(for plan: PremiumPlan) -> String? {
|
|
|
|
|
+ guard let product = storeKitCoordinator.productsByID[plan.rawValue],
|
|
|
|
|
+ let offer = product.subscription?.introductoryOffer,
|
|
|
|
|
+ offer.paymentMode == .freeTrial,
|
|
|
|
|
+ let trial = paywallSubscriptionPeriodDescription(offer.period) else {
|
|
|
|
|
+ return nil
|
|
|
|
|
+ }
|
|
|
|
|
+ return trial
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private func paywallPlanSubtitle(for plan: PremiumPlan) -> String {
|
|
private func paywallPlanSubtitle(for plan: PremiumPlan) -> String {
|
|
@@ -4368,18 +4374,15 @@ class ViewController: NSViewController {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if let offer = product.subscription?.introductoryOffer, offer.paymentMode == .freeTrial {
|
|
|
|
|
- let trial = paywallSubscriptionPeriodDescription(offer.period)
|
|
|
|
|
- if let trial {
|
|
|
|
|
- if let renewal = paywallSubscriptionPeriodDescription(product.subscription?.subscriptionPeriod) {
|
|
|
|
|
- return "Free for \(trial), then \(renewal)"
|
|
|
|
|
- }
|
|
|
|
|
- return "Free for \(trial)"
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if let period = product.subscription?.subscriptionPeriod,
|
|
|
|
|
+ let unit = paywallSubscriptionPeriodDescription(period),
|
|
|
|
|
+ let trial = paywallFreeTrialText(for: plan) {
|
|
|
|
|
+ return "\(product.displayPrice)/\(unit) • \(trial) free trial"
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if let renewal = paywallSubscriptionPeriodDescription(product.subscription?.subscriptionPeriod) {
|
|
|
|
|
- return "Billed \(renewal)"
|
|
|
|
|
|
|
+ if let period = product.subscription?.subscriptionPeriod,
|
|
|
|
|
+ let unit = paywallSubscriptionPeriodDescription(period) {
|
|
|
|
|
+ return "Billed \(unit)"
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
switch plan {
|
|
switch plan {
|
|
@@ -4427,10 +4430,10 @@ class ViewController: NSViewController {
|
|
|
return product.displayPrice
|
|
return product.displayPrice
|
|
|
}
|
|
}
|
|
|
switch plan {
|
|
switch plan {
|
|
|
- case .weekly: return "1,100.00"
|
|
|
|
|
- case .monthly: return "2,500.00"
|
|
|
|
|
- case .yearly: return "9,900.00"
|
|
|
|
|
- case .lifetime: return "14,900.00"
|
|
|
|
|
|
|
+ case .weekly: return "3.99"
|
|
|
|
|
+ case .monthly: return "7.99"
|
|
|
|
|
+ case .yearly: return "24.99"
|
|
|
|
|
+ case .lifetime: return "44.99"
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -4550,7 +4553,11 @@ class ViewController: NSViewController {
|
|
|
paywallContinueButton?.alphaValue = 0.75
|
|
paywallContinueButton?.alphaValue = 0.75
|
|
|
} else {
|
|
} else {
|
|
|
paywallContinueEnabled = true
|
|
paywallContinueEnabled = true
|
|
|
- paywallContinueLabel?.stringValue = paywallHasFreeTrial(for: selectedPremiumPlan) ? "Start with free trial" : "Continue"
|
|
|
|
|
|
|
+ if let trial = paywallFreeTrialText(for: selectedPremiumPlan) {
|
|
|
|
|
+ paywallContinueLabel?.stringValue = "Start with \(trial) trial"
|
|
|
|
|
+ } else {
|
|
|
|
|
+ paywallContinueLabel?.stringValue = "Continue"
|
|
|
|
|
+ }
|
|
|
paywallContinueButton?.alphaValue = 1.0
|
|
paywallContinueButton?.alphaValue = 1.0
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|