Explorar el Código

Prevent launch-time review prompts for existing premium users.

Only trigger the 10-second rating prompt after an in-session premium upgrade, and request a rating immediately when a long-time premium user opens signup/manage premium.

Made-with: Cursor
huzaifahayat12 hace 1 semana
padre
commit
e0a43f651e
Se han modificado 1 ficheros con 9 adiciones y 1 borrados
  1. 9 1
      meetings_app/ViewController.swift

+ 9 - 1
meetings_app/ViewController.swift

@@ -487,6 +487,10 @@ private extension ViewController {
487
 
487
 
488
     @objc private func premiumButtonClicked(_ sender: NSClickGestureRecognizer) {
488
     @objc private func premiumButtonClicked(_ sender: NSClickGestureRecognizer) {
489
         if storeKitCoordinator.hasPremiumAccess {
489
         if storeKitCoordinator.hasPremiumAccess {
490
+            if hasReachedRatingUsageThreshold && !userHasRated {
491
+                requestAppRatingIfEligible(markAsRated: false)
492
+                return
493
+            }
490
             showPaywall(upgradeFlow: true, preferredPlan: .lifetime)
494
             showPaywall(upgradeFlow: true, preferredPlan: .lifetime)
491
         } else {
495
         } else {
492
             showPaywall()
496
             showPaywall()
@@ -1059,7 +1063,11 @@ private extension ViewController {
1059
             Task { [weak self] in
1063
             Task { [weak self] in
1060
                 await self?.loadSchedule()
1064
                 await self?.loadSchedule()
1061
             }
1065
             }
1062
-            scheduleRatingPromptAfterPremiumUpgrade()
1066
+            // Skip delayed review prompt during initial launch entitlement sync.
1067
+            // We only want this after a real in-session upgrade.
1068
+            if hasCompletedInitialStoreKitSync {
1069
+                scheduleRatingPromptAfterPremiumUpgrade()
1070
+            }
1063
         }
1071
         }
1064
         if hadPremiumAccess && !hasPremiumAccess {
1072
         if hadPremiumAccess && !hasPremiumAccess {
1065
             showPaywall()
1073
             showPaywall()