Skip to content

feat(player): request an App Store review after finishing a movie or episode#100

Open
bilipp wants to merge 1 commit into
mainfrom
feat/appstore-request-review
Open

feat(player): request an App Store review after finishing a movie or episode#100
bilipp wants to merge 1 commit into
mainfrom
feat/appstore-request-review

Conversation

@bilipp

@bilipp bilipp commented Jun 28, 2026

Copy link
Copy Markdown
Owner

Summary

Lume never prompts users for an App Store rating, even though happy, engaged viewers are the ones most likely to leave a positive review. This adds an automatic, throttled review request that fires at a genuinely positive moment — right after the viewer finishes watching a movie or episode — using SwiftUI's requestReview action.

Implementation

  • AppStoreReviewTrigger (Lume/Services/Review/) — a nonisolated enum scalar-flag store (same shape as RecommendationSettings) that owns the throttling policy: it counts finished playbacks and reports eligibility only once ≥ 3 completions accumulate, and at most once per app marketing version (a future update is the soonest it will ask again). StoreKit independently caps the system prompt to three appearances a year, so this is conservative on top of that.
  • FullScreenPlayerView — hooks into the existing playback-completion seam in persistProgressDetached, right alongside the one-time Trakt "watched" sync. A Completion is only produced when a movie/episode crosses 90% (never for live channels), so the trigger naturally fires only on meaningful VOD finishes. The requestReview environment action is gated #if !os(tvOS) — tvOS has no App Store rating prompt.

No new user-facing strings (the prompt is system-provided), so no localization changes were needed. The existing manual "Rate Lume" link in Settings is unaffected and complements this automatic path.

Testing

  • Acceptance criteria met (throttled prompt fires after meaningful engagement; once per version)
  • Tests pass — see note below
  • SwiftLint clean (pre-commit hooks passed)
  • Tests added — LumeTests/Services/AppStoreReviewTriggerTests.swift covers the threshold, the per-version block, and re-eligibility after an update, using an isolated UserDefaults suite.

Note: The app target builds successfully on the iOS Simulator with this change. The LumeTests target currently has a pre-existing compile error unrelated to this PR — ModelTests/GenreDerivationTests pass a ModelContext where a ModelContainer is expected (these files are unchanged from main). That breaks compilation of the whole test target, so the new AppStoreReviewTriggerTests could not be executed in-suite until that is fixed separately.

Platforms

  • iOS / iPadOS
  • tvOS (intentionally excluded — no rating prompt API)
  • macOS
  • visionOS

Related

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant