rating_review_sdk Free
In-app rating and review SDK. Wraps
in_app_reviewwith smart-prompting heuristics (session/key-event thresholds, cooldown, per-version gate). Thresholds are configured at runtime viaRatingPromptConfig, 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
archipelago generate rating_review_sdkNon-interactive (CI)
archipelago generate rating_review_sdk --config my_config.jsonGenerated 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:
- Platform availability —
InAppReview.isAvailable()must returntrue - Session threshold — user must have completed
minSessionsapp launches - Key event threshold — user must have triggered
minKeyEventspositive moments - Cooldown period — at least
cooldownDaysmust have passed since the last prompt - Per-version gate — if
askOncePerVersionistrue, 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:
@module
abstract class AppDIModule {
@lazySingleton
RatingPromptConfig get ratingPromptConfig => const RatingPromptConfig(
minSessions: 3,
minKeyEvents: 2,
cooldownDays: 30,
askOncePerVersion: true,
iosAppStoreId: 'YOUR_APP_STORE_ID',
);
}Integration
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:
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.