Переглянути джерело

Show subscription-cancel reminder only after lifetime purchase.

Skip the pre-purchase lifetime warning and instead display the cancellation reminder after successful lifetime activation, while keeping the generic premium-upgrade confirmation for non-lifetime plans.

Made-with: Cursor
huzaifahayat12 1 місяць тому
батько
коміт
a657c9e36d
1 змінених файлів з 16 додано та 9 видалено
  1. 16 9
      meetings_app/ViewController.swift

+ 16 - 9
meetings_app/ViewController.swift

@@ -1026,13 +1026,8 @@ private extension ViewController {
1026 1026
 
1027 1027
     private func confirmPremiumUpgrade(for targetPlan: PremiumPlan) -> Bool {
1028 1028
         let alert = NSAlert()
1029
-        if targetPlan == .lifetime, storeKitCoordinator.hasPremiumAccess, !storeKitCoordinator.hasLifetimeAccess {
1030
-            alert.messageText = "Switching to Lifetime"
1031
-            alert.informativeText = "You already have an active subscription. If you buy Lifetime, cancel your current subscription in App Store Subscriptions to avoid future renewal charges."
1032
-        } else {
1033
-            alert.messageText = "Already Premium"
1034
-            alert.informativeText = "You are already premium. Do you want to continue with this purchase?"
1035
-        }
1029
+        alert.messageText = "Already Premium"
1030
+        alert.informativeText = "You are already premium. Do you want to continue with this purchase?"
1036 1031
         alert.addButton(withTitle: "Continue")
1037 1032
         alert.addButton(withTitle: "Cancel")
1038 1033
         return alert.runModal() == .alertFirstButtonReturn
@@ -1531,7 +1526,10 @@ private extension ViewController {
1531 1526
             }
1532 1527
             return
1533 1528
         }
1534
-        if paywallUpgradeFlowEnabled && storeKitCoordinator.hasPremiumAccess && !confirmPremiumUpgrade(for: selectedPremiumPlan) {
1529
+        if paywallUpgradeFlowEnabled,
1530
+           storeKitCoordinator.hasPremiumAccess,
1531
+           selectedPremiumPlan != .lifetime,
1532
+           !confirmPremiumUpgrade(for: selectedPremiumPlan) {
1535 1533
             return
1536 1534
         }
1537 1535
         paywallPurchaseTask?.cancel()
@@ -1548,7 +1546,16 @@ private extension ViewController {
1548 1546
                 Task { [weak self] in
1549 1547
                     await self?.loadSchedule()
1550 1548
                 }
1551
-                self.showSimpleAlert(title: "Purchase Complete", message: "Premium has been unlocked successfully.")
1549
+                if selectedPlan == .lifetime, self.storeKitCoordinator.activeNonLifetimePlan != nil {
1550
+                    self.showSimpleAlert(
1551
+                        title: "Lifetime Premium Activated",
1552
+                        message: "You are premium for lifetime now. Please cancel your previous subscription in App Store Subscriptions to avoid future renewal charges."
1553
+                    )
1554
+                } else if selectedPlan == .lifetime {
1555
+                    self.showSimpleAlert(title: "Purchase Complete", message: "Lifetime premium has been unlocked successfully.")
1556
+                } else {
1557
+                    self.showSimpleAlert(title: "Purchase Complete", message: "Premium has been unlocked successfully.")
1558
+                }
1552 1559
                 self.dismissPaywallIfPresented()
1553 1560
                 self.scheduleRatingPromptAfterPremiumUpgrade()
1554 1561
             case .cancelled: