Review prompt tras check-in: ≥2 meses de histórico, una vez por versión (build 85) #41
- ReviewRequestService: gate por meses distintos con snapshots + versión - QuickUpdateView.saveAll y AddSnapshotView.performSave (solo alta, no edición) piden reseña via \.requestReview tras cerrar el sheet - Motivo: 0 ratings visibles en US, 1 en ES — la ficha no convierte Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VXtwQP6nYnbLFVqsHiTK5G
This commit is contained in:
@@ -3,9 +3,11 @@ import CoreData
|
||||
import TipKit
|
||||
import UIKit
|
||||
import PhotosUI
|
||||
import StoreKit
|
||||
|
||||
struct QuickUpdateView: View {
|
||||
@Environment(\.dismiss) private var dismiss
|
||||
@Environment(\.requestReview) private var requestReview
|
||||
@Environment(\.managedObjectContext) private var context
|
||||
@Environment(\.scenePhase) private var scenePhase
|
||||
@FetchRequest(
|
||||
@@ -375,6 +377,11 @@ struct QuickUpdateView: View {
|
||||
}
|
||||
// Keep the share-extension mirror in sync with what was just saved
|
||||
SharedQuickUpdateSync.refreshMirror()
|
||||
// Positive moment: check-in saved. Ask for a rating once the sheet
|
||||
// is gone (gated to ≥2 months of history, once per version).
|
||||
if ReviewRequestService.shouldRequestAfterCheckIn() {
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 1.2) { requestReview() }
|
||||
}
|
||||
dismiss()
|
||||
} catch {
|
||||
saveError = error.localizedDescription
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import SwiftUI
|
||||
import StoreKit
|
||||
|
||||
struct AddSourceView: View {
|
||||
@Environment(\.dismiss) private var dismiss
|
||||
@@ -415,6 +416,7 @@ struct EditSourceView: View {
|
||||
struct AddSnapshotView: View {
|
||||
@Environment(\.dismiss) private var dismiss
|
||||
@Environment(\.scenePhase) private var scenePhase
|
||||
@Environment(\.requestReview) private var requestReview
|
||||
let source: InvestmentSource
|
||||
let snapshot: Snapshot?
|
||||
|
||||
@@ -648,6 +650,12 @@ struct AddSnapshotView: View {
|
||||
return
|
||||
}
|
||||
|
||||
// Positive moment: check-in saved (new snapshots only, not edits).
|
||||
// Gated to ≥2 months of history, once per version.
|
||||
if !isEdit, ReviewRequestService.shouldRequestAfterCheckIn() {
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 1.2) { requestReview() }
|
||||
}
|
||||
|
||||
dismiss()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user