technical:features:31_review_prompts
Table of Contents
31 — Review prompts
Technical reference. For task-based help, see the corresponding user guide.
Documentation status: reviewed against implementation · Reviewed: 2026-07-21 · Primary users: eligible family users and actively subscribed coaches · Surfaces: mobile web, native wrapper and platform API
Purpose
The app asks for a store review only after sustained use, and never through a blocking custom rating form. Family and coach eligibility are tracked independently so a dual-role account's activity in one product context cannot consume the other context's prompt.
Eligibility summary
| Requirement | Family audience | Coach audience |
|---|---|---|
| Main route | Family home/root in family context | Coach home/root in coach context |
| Platform | Native iOS or Android bridge | Native iOS or Android bridge |
| Engagement | 7 distinct recorded calendar-day keys with a successful self-family activity | 7 distinct recorded calendar-day keys opening/using the coach dashboard while subscription-eligible |
| Additional gate | A selected baby | Latest subscription for the primary active coach organization is exactly active |
| Cooldown | No successful request in the previous 6 calendar months | Same |
| Prompt contention | No notification banner/other claimed experience | Same shared prompt-experience lock |
trialing, canceled, expired or missing coach subscriptions do not qualify. Recording a coach day is idempotent for that local calendar date and returns subscriptionEligible: false without advancing state when the exact active-subscription rule is not met.
Functional flow
1. Accumulate family engagement
- After a family actor successfully creates an activity for their own household, the platform adds that local day key if it is new.
- Coach-created activity in a client context does not count toward the family's review eligibility.
- On the seventh distinct day,
firstEligibleAtis retained in familyreviewPromptstate.
2. Accumulate coach engagement
- On an eligible coach dashboard route, mobile calls
POST /coach/review-prompt/activity-day. - The platform selects the coach's primary active organization and latest coach subscription. Only status
activerecords the day. - Coach state is stored separately as
coachReviewPrompt; repeated visits on the same day do not increase the count.
3. Ask the native store
- The host waits two seconds after reaching the eligible home route.
- It loads/records the audience state, checks seven days, selected baby or active subscription, cooldown, native platform and prompt contention.
- If eligible, it claims the shared
reviewPromptexperience and calls nativestoreReview.request. - There is no app-rendered star dialog. iOS/Android decides whether and how to show its store sheet.
4. Record only a successful native request
- Only when the bridge returns true does mobile report
review_prompt_shownand PATCH the attempt with platform and current web-release version. - The server sets
lastRequestedAt,lastRequestedPlatform,lastRequestedAppVersionandnextAllowedAtsix months later. - Unsupported bridge, native denial, exception or a lost prompt-experience race does not consume the server cooldown.
State model
| Field | Meaning |
|---|---|
trackedActivityDayKeys | Unique server-recorded YYYY-MM-DD engagement day keys. |
firstEligibleAt | First moment the seventh distinct day was reached. |
lastRequestedAt | Last successfully acknowledged native request. |
lastRequestedPlatform | ios or android. |
lastRequestedAppVersion | Web release reported at the attempt. |
nextAllowedAt | Six-calendar-month cooldown boundary. |
User-visible and failure behaviour
- The feature renders no persistent settings panel and never blocks dashboard use.
- A notification banner has the same shared presentation channel; the review attempt waits/abandons rather than overlapping it.
- Eligibility/API/native errors are swallowed as best-effort failures. A later eligible visit can retry.
- A successful native request does not prove that the operating system displayed a sheet or that the user left a review.
- The manual Review app side-menu link is a separate direct store action and is not governed by these automatic eligibility rules.
Platform API contract
| Method and route | Audience | Purpose |
|---|---|---|
GET /families/me/review-prompt | Family | Read family state plus selected baby. |
PATCH /families/me/review-prompt/attempt | Family | Record a mobile-reported successful native family request and its platform/version. |
POST /coach/review-prompt/activity-day | Coach | Idempotently record an eligible coach dashboard day and return subscription eligibility. |
PATCH /coach/review-prompt/attempt | Coach | Record a successful native coach request after rechecking active subscription, days and cooldown. |
Authorization and integrity
- State is bound to the authenticated actor; no request accepts another user ID.
- Coach attempt writes recheck day count, cooldown and the latest primary-organization subscription inside the write.
- The current family attempt write checks the family actor and request shape/date but does not independently re-evaluate seven days, selected baby or cooldown. Those family gates currently live in the mobile host.
- Family and coach JSON state use different user fields. Default role/route chooses which state a dual-role actor evaluates.
- Client timing and the prompt-experience lock improve presentation but do not replace server attempt validation.
“Request accepted” is the strongest product signal available. Store APIs intentionally do not disclose whether the sheet appeared or whether a review was submitted. Also note the current integrity asymmetry: coach attempt eligibility is server-enforced, while family attempt eligibility is client-enforced before a role-checked write.
Acceptance checklist
- [ ] Seven distinct dates are required; multiple events/visits on one date count once.
- [ ] Mobile family eligibility requires selected baby and self-created family activity days; tests also capture that the current family attempt endpoint does not recheck those gates.
- [ ] Coach requires latest subscription status exactly
activeboth when counting and recording attempt. - [ ] Family and coach states remain separate for a dual-role actor.
- [ ] Prompt runs only on native iOS/Android home routes after the delay.
- [ ] Notification banner and review request never display concurrently.
- [ ] Cooldown is written only after native returns true and lasts six calendar months.
- [ ] Unsupported/failing native API does not block the app or consume cooldown.
Source evidence
- Mobile web:
mobile-web/src/components/ReviewPromptHost.tsx,mobile-web/src/utils/review-prompt.ts,mobile-web/src/webview/native-messages.ts - Platform:
platform/packages/shared/src/review-prompt.ts,platform/apps/api/src/routes/family-routes.ts,platform/apps/api/src/routes/coach-routes.ts,platform/apps/api/src/services/coach-review-prompt-service.ts, family activity/review state services - Native wrapper: store-review bridge handler and platform store-review adapter under
mobile-wrapper/src/native/
