Activate InAppReviewService and wire up review prompts - #260
Merged
Conversation
Wires the previously-dormant InAppReviewService into Koin using the existing BrainwalletApp.breadContext activity tracker. No call sites added yet — showInAppReviewDialogIfNeeded() is not invoked anywhere, so behavior is unchanged until it's called from the app.
Registers InAppReviewService in Koin DI and calls showInAppReviewDialogIfNeeded() from four placements: after a successful send, the game hub exit flow, the balance-visibility toggle, and two tutorial pages. Fixes several placement bugs found along the way (broken suspend-context usage, unresolved DI references, malformed syntax, and an unreachable branch in GameHubViewModel), and adds unit test coverage for the service's gating and Play Core success/failure branches.
kcw-grunt
approved these changes
Jul 31, 2026
| val activity = activityProvider() ?: return | ||
| if (!BRSharedPrefs.isInAppReviewDone(app) && | ||
| BRSharedPrefs.getSendTransactionCount(app) > 2 | ||
| BRSharedPrefs.getSendTransactionCount(app) > 1 |
kcw-grunt
pushed a commit
that referenced
this pull request
Jul 31, 2026
commit f701d2d Author: grunt-claude-bot <admin@brainwallet.co> Date: Fri Jul 31 08:55:58 2026 +0100 Activate InAppReviewService and wire up review prompts (#260) * di: register InAppReviewService in AppModule Wires the previously-dormant InAppReviewService into Koin using the existing BrainwalletApp.breadContext activity tracker. No call sites added yet — showInAppReviewDialogIfNeeded() is not invoked anywhere, so behavior is unchanged until it's called from the app. * feat: activate InAppReviewService and wire up review prompts Registers InAppReviewService in Koin DI and calls showInAppReviewDialogIfNeeded() from four placements: after a successful send, the game hub exit flow, the balance-visibility toggle, and two tutorial pages. Fixes several placement bugs found along the way (broken suspend-context usage, unresolved DI references, malformed syntax, and an unreachable branch in GameHubViewModel), and adds unit test coverage for the service's gating and Play Core success/failure branches. commit 1a71dad Author: grunt-claude-bot <admin@brainwallet.co> Date: Thu Jul 30 16:42:24 2026 +0100 docs: add v4.11.0 release notes to README commit faac661 Merge: 07224b9 3f2db9d Author: Kerry Washington <mrkerrywashington@icloud.com> Date: Thu Jul 30 16:14:18 2026 +0100 Merge branch 'main' into release/v4.11.0 commit 07224b9 Author: grunt-claude-bot <admin@brainwallet.co> Date: Thu Jul 30 16:10:21 2026 +0100 test: add unit test coverage for pure utility helpers and gameinterface logic Covers previously-untested Base58, TypesConverter, BytesUtil, BRCompressor, and BRDateUtil classes, plus the GameKoinModule DI wiring and GdxGameView's game-exit JSON parsing/social-share dispatch logic (GameExitData and handleGameExit widened from private to internal to make them testable). commit 3f2db9d Author: grunt-claude-bot <admin@brainwallet.co> Date: Wed Jul 29 14:17:53 2026 +0100 docs: standardize release headers to bold version + PR + divider format (#254) (#256) Co-authored-by: grunt-claude-bot <308083480+grunt-claude-bot@users.noreply.github.com>
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.
📱 Description
Activates the previously-dormant
InAppReviewService(added in #242 but never wired up): registers it in Koin DI and callsshowInAppReviewDialogIfNeeded()from four placements — after a successful send, the game hub exit/share flow, the balance-visibility toggle, and two tutorial pages. Also fixes several bugs found while reviewing each manual placement, and adds unit test coverage for the service itself.Platform
🎯 Type of Change
📋 Changes
New Components Added
InAppReviewServiceTest.kt— covers all gating branches (no current activity, review already done, send count below threshold) and both Play Core success/failure paths (request flow failure, launch flow failure, full success updating the done-flag and analytics)Modifications
AppModule.kt: registersInAppReviewServiceas a Koinsingle, using the existingBrainwalletApp.breadContextactivity trackerInAppReviewService.kt: lowered the send-count gate from> 2to> 1SendViewModel.kt/SendViewModelTest.kt: addedInAppReviewServiceas a constructor parameter (resolved automatically via@KoinViewModel), callsshowInAppReviewDialogIfNeeded()800ms after a successful send; test updated with a mockGameHubViewModel.kt: addedInAppReviewServiceas a constructor parameter; fixed a broken placement that had landed inside anIntentbuilder call's argument list (invalid syntax), used an undefinedcoroutineScopeinstead ofviewModelScope, and had been placed in an unreachablewhenbranch — moved the trigger to fire once per game-exit share, regardless of networkBalanceBentoScreen.kt: injectsInAppReviewServiceviakoinInject(), addsrememberCoroutineScope()to allow the delayed call from a non-suspendclickablehandler (fixes a "suspend function can only be called from a coroutine" compile error and an unresolved reference)TutorialSendPage2.kt/TutorialWalkthroughPage3.kt: injectInAppReviewServiceviakoinInject()and trigger the check inLaunchedEffectapp/build.gradle.kts: version code bump (202506346 → 202506347)Removals
None
📊 Statistics
🧪 Tests Status
./gradlew testBrainwalletDebugUnitTest, full suite green)InAppReviewServiceTest, plus updatedSendViewModelTestfor the new constructor param🎯 Reviewers
@kcw-grunt, @josikie