Feature SDKs (Free)
rating_review_sdk Free
- Tier
- Freeversion 2.0.4
- Command
archipelago generate rating_review_sdk- Generates
features/rating_review/rating_review_apifeatures/rating_review/rating_review_impl
- Generates first
- storage_sdk, package_info_providerwhen needed and missing, so there is nothing to install first
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.
Variables
This brick has no generation-time variables. All prompting behaviour is configured at runtime via RatingPromptConfig.
Prerequisites
rating_review_impl persists session/key-event counters and prompt history through storage_sdk_api's StorageProvider, and consumes PackageInfo from package_info_provider's single global registration, instead of registering either itself (two features doing that independently crashed GetIt with a duplicate-registration error).
storage_sdk— self-generated automatically if not already installed (since 1.4.0), no manual step.package_info_provider— self-generated automatically if not already installed (since 1.4.2), no manual step.
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});
}reset() clears all persisted state (session counter, key-event tally, last-prompt timestamp and version) — useful for tests or an explicit "ask me again later" flow:
await ratingSDK.reset();DI and wiring notes
rating_review_impl/pubspec.yaml declares its archipelago: di_modules block for monorepo_toolkit generate host-registry:
archipelago:
di_modules:
- class: RatingReviewImplPackageModule
depends_on:
- storage_sdk_shared_preferences
- package_info_providerRatingReviewSDKImpl is registered as a lazy @LazySingleton(as: RatingReviewSDK) (since 2.0.0): it does no startup work, so it is built the first time something resolves RatingReviewSDK. It requests its own 'rating_review' namespace from StorageProvider — non-secure, StorageScope.application (the default), so its counters are not swept by a logout-clear coordinator.
Dependencies
storage_sdk_api— self-generated automatically if not already installedpackage_info_provider— self-generated automatically if not already installedin_app_review— wraps the nativeInAppReview/SKStoreReviewRequestAPIplugin
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.
Known Limitations
- There is deliberately no "already rated" skip reason — neither Apple's nor Google's review API exposes whether the user actually submitted a rating. The
withinCooldown+alreadyShownThisVersiongates approximate the same effect instead. requestReview()'s return value reflects whether the SDK decided to call the plugin, not whether the user actually saw or completed the native dialog — both platforms may silently throttle it regardless.
Changelog
Run archipelago brick info rating_review_sdk to see the latest published version. Enterprise customers can read the full CHANGELOG.md in the brick source repository.