|
@@ -1026,13 +1026,8 @@ private extension ViewController {
|
|
1026
|
|
1026
|
|
|
1027
|
private func confirmPremiumUpgrade(for targetPlan: PremiumPlan) -> Bool {
|
1027
|
private func confirmPremiumUpgrade(for targetPlan: PremiumPlan) -> Bool {
|
|
1028
|
let alert = NSAlert()
|
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
|
alert.addButton(withTitle: "Continue")
|
1031
|
alert.addButton(withTitle: "Continue")
|
|
1037
|
alert.addButton(withTitle: "Cancel")
|
1032
|
alert.addButton(withTitle: "Cancel")
|
|
1038
|
return alert.runModal() == .alertFirstButtonReturn
|
1033
|
return alert.runModal() == .alertFirstButtonReturn
|
|
@@ -1531,7 +1526,10 @@ private extension ViewController {
|
|
1531
|
}
|
1526
|
}
|
|
1532
|
return
|
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
|
return
|
1533
|
return
|
|
1536
|
}
|
1534
|
}
|
|
1537
|
paywallPurchaseTask?.cancel()
|
1535
|
paywallPurchaseTask?.cancel()
|
|
@@ -1548,7 +1546,16 @@ private extension ViewController {
|
|
1548
|
Task { [weak self] in
|
1546
|
Task { [weak self] in
|
|
1549
|
await self?.loadSchedule()
|
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
|
self.dismissPaywallIfPresented()
|
1559
|
self.dismissPaywallIfPresented()
|
|
1553
|
self.scheduleRatingPromptAfterPremiumUpgrade()
|
1560
|
self.scheduleRatingPromptAfterPremiumUpgrade()
|
|
1554
|
case .cancelled:
|
1561
|
case .cancelled:
|