ソースを参照

Align StoreKit prices and trial UI with classroom app

Update StoreKit test catalog to USD tiers and adjust paywall trial/subtitle/CTA formatting to avoid optional text and match classroom paywall copy.

Co-authored-by: Cursor <cursoragent@cursor.com>
huzaifahayat12 2 ヶ月 前
コミット
77e61f8606
2 ファイル変更31 行追加24 行削除
  1. 4 4
      zoom_app/StoreKit.storekit
  2. 27 20
      zoom_app/ViewController.swift

+ 4 - 4
zoom_app/StoreKit.storekit

@@ -3,7 +3,7 @@
   "nonRenewingSubscriptions" : [],
   "products" : [
     {
-      "displayPrice" : "14900.00",
+      "displayPrice" : "44.99",
       "familyShareable" : false,
       "internalID" : "D01B7280-2C4C-4FB1-AC1F-4E61B70A1F6D",
       "localizations" : [
@@ -38,7 +38,7 @@
         {
           "adHocOffers" : [],
           "codeOffers" : [],
-          "displayPrice" : "1100.00",
+          "displayPrice" : "3.99",
           "familyShareable" : false,
           "groupNumber" : 3,
           "internalID" : "64D1B757-30B3-4D8A-AE2A-83B6E2B9B4A7",
@@ -59,7 +59,7 @@
         {
           "adHocOffers" : [],
           "codeOffers" : [],
-          "displayPrice" : "2500.00",
+          "displayPrice" : "7.99",
           "familyShareable" : false,
           "groupNumber" : 2,
           "internalID" : "5F0659F3-9E3E-4E7A-95A4-87F68F63AE64",
@@ -80,7 +80,7 @@
         {
           "adHocOffers" : [],
           "codeOffers" : [],
-          "displayPrice" : "9900.00",
+          "displayPrice" : "24.99",
           "familyShareable" : false,
           "groupNumber" : 1,
           "internalID" : "CE6E8B9A-65D4-4E3A-9EB2-5B81A410F1E0",

+ 27 - 20
zoom_app/ViewController.swift

@@ -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)
             if let 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 {
@@ -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 {
@@ -4427,10 +4430,10 @@ class ViewController: NSViewController {
             return product.displayPrice
         }
         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
         } else {
             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
         }
     }