Skip to content

Activate InAppReviewService and wire up review prompts - #260

Merged
kcw-grunt merged 2 commits into
release/v4.11.0from
claude/review-request-update
Jul 31, 2026
Merged

Activate InAppReviewService and wire up review prompts#260
kcw-grunt merged 2 commits into
release/v4.11.0from
claude/review-request-update

Conversation

@grunt-claude-bot

Copy link
Copy Markdown
Collaborator

📱 Description

Activates the previously-dormant InAppReviewService (added in #242 but never wired up): registers it in Koin DI and calls showInAppReviewDialogIfNeeded() 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

  • Android

🎯 Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 🔧 Refactoring (code change that neither fixes a bug nor adds a feature)
  • 📚 Documentation update
  • 🎨 UI/UX improvement
  • ⚡ Performance improvement
  • 🧪 Test addition or improvement

📋 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: registers InAppReviewService as a Koin single, using the existing BrainwalletApp.breadContext activity tracker
  • InAppReviewService.kt: lowered the send-count gate from > 2 to > 1
  • SendViewModel.kt / SendViewModelTest.kt: added InAppReviewService as a constructor parameter (resolved automatically via @KoinViewModel), calls showInAppReviewDialogIfNeeded() 800ms after a successful send; test updated with a mock
  • GameHubViewModel.kt: added InAppReviewService as a constructor parameter; fixed a broken placement that had landed inside an Intent builder call's argument list (invalid syntax), used an undefined coroutineScope instead of viewModelScope, and had been placed in an unreachable when branch — moved the trigger to fire once per game-exit share, regardless of network
  • BalanceBentoScreen.kt: injects InAppReviewService via koinInject(), adds rememberCoroutineScope() to allow the delayed call from a non-suspend clickable handler (fixes a "suspend function can only be called from a coroutine" compile error and an unresolved reference)
  • TutorialSendPage2.kt / TutorialWalkthroughPage3.kt: inject InAppReviewService via koinInject() and trigger the check in LaunchedEffect
  • app/build.gradle.kts: version code bump (202506346 → 202506347)

Removals

None

📊 Statistics

  • Additions: 225 lines
  • Deletions: 13 lines
  • Files Changed: 10
  • Commits: 2

🧪 Tests Status

  • Tests ran successfully locally (./gradlew testBrainwalletDebugUnitTest, full suite green)
  • Added more tests? 7 new tests in InAppReviewServiceTest, plus updated SendViewModelTest for the new constructor param
  • Code coverage percentage of the codebase: not measured

🎯 Reviewers

@kcw-grunt, @josikie

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 kcw-grunt left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

val activity = activityProvider() ?: return
if (!BRSharedPrefs.isInAppReviewDone(app) &&
BRSharedPrefs.getSendTransactionCount(app) > 2
BRSharedPrefs.getSendTransactionCount(app) > 1

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will adjust over time

@kcw-grunt
kcw-grunt merged commit f701d2d into release/v4.11.0 Jul 31, 2026
3 checks passed
@kcw-grunt
kcw-grunt deleted the claude/review-request-update branch July 31, 2026 07:56
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants