Skip to content

rating_review_sdk Free

In-app rating and review SDK. Wraps in_app_review with smart-prompting heuristics (session/key-event thresholds, cooldown, per-version gate). Thresholds are configured at runtime via RatingPromptConfig, not at generation time.

Version: 1.0.0

Variables

This brick has no generation-time variables. All prompting behaviour is configured at runtime via RatingPromptConfig.

Usage

Interactive

bash
archipelago generate rating_review_sdk

Non-interactive (CI)

bash
archipelago generate rating_review_sdk --config my_config.json

Generated Structure

features/
└── rating_review/
    ├── rating_review_api/
    │   └── lib/src/
    │       └── models/
    └── rating_review_impl/
        └── lib/src/
            └── di/

Smart-Prompting Gates

The SDK evaluates conditions in this order before showing the prompt:

  1. Platform availabilityInAppReview.isAvailable() must return true
  2. Session threshold — user must have completed minSessions app launches
  3. Key event threshold — user must have triggered minKeyEvents positive moments
  4. Cooldown period — at least cooldownDays must have passed since the last prompt
  5. Per-version gate — if askOncePerVersion is true, prompt is shown at most once per app version string

Runtime Configuration

Override the default thresholds by providing a RatingPromptConfig in your DI module before RatingReviewImplPackageModule:

dart
@module
abstract class AppDIModule {
  @lazySingleton
  RatingPromptConfig get ratingPromptConfig => const RatingPromptConfig(
    minSessions: 3,
    minKeyEvents: 2,
    cooldownDays: 30,
    askOncePerVersion: true,
    iosAppStoreId: 'YOUR_APP_STORE_ID',
  );
}

Integration

dart
final ratingSDK = getIt<RatingReviewSDK>();

// Once per app launch (post-launch hook or app shell initState):
await ratingSDK.recordSession();

// After a positive user moment:
await ratingSDK.recordKeyEvent('checkout_completed');

// At an appropriate UX moment (e.g. success screen):
if (await ratingSDK.shouldRequestReview()) {
  await ratingSDK.requestReview();
}

Analytics Integration

Use evaluatePromptDecision() to get structured decision results for telemetry without triggering the prompt:

dart
final decision = await ratingSDK.evaluatePromptDecision();
switch (decision) {
  case RatingPromptDecisionShow():
    await ratingSDK.requestReview();
  case RatingPromptDecisionSkip(:final reason):
    analytics.track('rating_prompt_skipped', {'reason': reason.name});
}

Platform Setup

iOS

Set iosAppStoreId in RatingPromptConfig so openStoreListing() works correctly. Without it, openStoreListing() is a no-op on iOS. No Info.plist changes are required.

Android

The In-App Review API requires your app to be available on the Play Store (internal testing track is sufficient). In debug builds, InAppReview.isAvailable() returns false — the SDK silently skips all prompts, which is the expected behaviour.

Built by Banua Coder