feat(player): request an App Store review after finishing a movie or episode#100
Open
bilipp wants to merge 1 commit into
Open
feat(player): request an App Store review after finishing a movie or episode#100bilipp wants to merge 1 commit into
bilipp wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
requestReviewaction.Implementation
AppStoreReviewTrigger(Lume/Services/Review/) — anonisolated enumscalar-flag store (same shape asRecommendationSettings) 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 inpersistProgressDetached, right alongside the one-time Trakt "watched" sync. ACompletionis only produced when a movie/episode crosses 90% (never for live channels), so the trigger naturally fires only on meaningful VOD finishes. TherequestReviewenvironment 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
LumeTests/Services/AppStoreReviewTriggerTests.swiftcovers the threshold, the per-version block, and re-eligibility after an update, using an isolatedUserDefaultssuite.Platforms
Related