|
@@ -1026,13 +1026,8 @@ private extension ViewController {
|
|
|
|
|
|
|
|
private func confirmPremiumUpgrade(for targetPlan: PremiumPlan) -> Bool {
|
|
private func confirmPremiumUpgrade(for targetPlan: PremiumPlan) -> Bool {
|
|
|
let alert = NSAlert()
|
|
let alert = NSAlert()
|
|
|
- if targetPlan == .lifetime, storeKitCoordinator.hasPremiumAccess, !storeKitCoordinator.hasLifetimeAccess {
|
|
|
|
|
- alert.messageText = "Switching to Lifetime"
|
|
|
|
|
- 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."
|
|
|
|
|
- } else {
|
|
|
|
|
- alert.messageText = "Already Premium"
|
|
|
|
|
- alert.informativeText = "You are already premium. Do you want to continue with this purchase?"
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ alert.messageText = "Already Premium"
|
|
|
|
|
+ alert.informativeText = "You are already premium. Do you want to continue with this purchase?"
|
|
|
alert.addButton(withTitle: "Continue")
|
|
alert.addButton(withTitle: "Continue")
|
|
|
alert.addButton(withTitle: "Cancel")
|
|
alert.addButton(withTitle: "Cancel")
|
|
|
return alert.runModal() == .alertFirstButtonReturn
|
|
return alert.runModal() == .alertFirstButtonReturn
|
|
@@ -1531,7 +1526,10 @@ private extension ViewController {
|
|
|
}
|
|
}
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
- if paywallUpgradeFlowEnabled && storeKitCoordinator.hasPremiumAccess && !confirmPremiumUpgrade(for: selectedPremiumPlan) {
|
|
|
|
|
|
|
+ if paywallUpgradeFlowEnabled,
|
|
|
|
|
+ storeKitCoordinator.hasPremiumAccess,
|
|
|
|
|
+ selectedPremiumPlan != .lifetime,
|
|
|
|
|
+ !confirmPremiumUpgrade(for: selectedPremiumPlan) {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
paywallPurchaseTask?.cancel()
|
|
paywallPurchaseTask?.cancel()
|
|
@@ -1548,7 +1546,16 @@ private extension ViewController {
|
|
|
Task { [weak self] in
|
|
Task { [weak self] in
|
|
|
await self?.loadSchedule()
|
|
await self?.loadSchedule()
|
|
|
}
|
|
}
|
|
|
- self.showSimpleAlert(title: "Purchase Complete", message: "Premium has been unlocked successfully.")
|
|
|
|
|
|
|
+ if selectedPlan == .lifetime, self.storeKitCoordinator.activeNonLifetimePlan != nil {
|
|
|
|
|
+ self.showSimpleAlert(
|
|
|
|
|
+ title: "Lifetime Premium Activated",
|
|
|
|
|
+ message: "You are premium for lifetime now. Please cancel your previous subscription in App Store Subscriptions to avoid future renewal charges."
|
|
|
|
|
+ )
|
|
|
|
|
+ } else if selectedPlan == .lifetime {
|
|
|
|
|
+ self.showSimpleAlert(title: "Purchase Complete", message: "Lifetime premium has been unlocked successfully.")
|
|
|
|
|
+ } else {
|
|
|
|
|
+ self.showSimpleAlert(title: "Purchase Complete", message: "Premium has been unlocked successfully.")
|
|
|
|
|
+ }
|
|
|
self.dismissPaywallIfPresented()
|
|
self.dismissPaywallIfPresented()
|
|
|
self.scheduleRatingPromptAfterPremiumUpgrade()
|
|
self.scheduleRatingPromptAfterPremiumUpgrade()
|
|
|
case .cancelled:
|
|
case .cancelled:
|