@shotik/mcp 0.1.2 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1006 @@
1
+ {
2
+ "schema": "shotik.audit-checklist/1",
3
+ "areas": [
4
+ "onboarding",
5
+ "paywall",
6
+ "purchase",
7
+ "apple-rule"
8
+ ],
9
+ "stacks": [
10
+ "react-native",
11
+ "expo",
12
+ "swift",
13
+ "swiftui",
14
+ "flutter",
15
+ "kotlin"
16
+ ],
17
+ "fallback": {
18
+ "expo": "react-native",
19
+ "swiftui": "swift"
20
+ },
21
+ "benchmarks": {
22
+ "react-native": {
23
+ "purchases": [
24
+ "react-native-purchases",
25
+ "react-native-iap"
26
+ ],
27
+ "look": [
28
+ "App.tsx or the root navigator",
29
+ "the paywall screen",
30
+ "the onboarding stack",
31
+ "storage of the onboarded/isPro flags"
32
+ ]
33
+ },
34
+ "expo": {
35
+ "purchases": [
36
+ "react-native-purchases",
37
+ "expo-iap"
38
+ ],
39
+ "look": [
40
+ "app/_layout.tsx and expo-router groups",
41
+ "app.json or app.config ios.infoPlist",
42
+ "the paywall route",
43
+ "expo-notifications, expo-tracking-transparency and expo-store-review calls"
44
+ ]
45
+ },
46
+ "swift": {
47
+ "purchases": [
48
+ "StoreKit 2 (Product, Transaction)",
49
+ "RevenueCat"
50
+ ],
51
+ "look": [
52
+ "AppDelegate didFinishLaunching",
53
+ "Info.plist purpose strings",
54
+ "the paywall view controller",
55
+ "Transaction.updates and currentEntitlements"
56
+ ]
57
+ },
58
+ "swiftui": {
59
+ "purchases": [
60
+ "StoreKit 2 and SubscriptionStoreView",
61
+ "RevenueCat"
62
+ ],
63
+ "look": [
64
+ "the @main App and root .task",
65
+ "the paywall View",
66
+ "Info.plist purpose strings",
67
+ "@Environment(\\.requestReview)"
68
+ ]
69
+ },
70
+ "flutter": {
71
+ "purchases": [
72
+ "in_app_purchase",
73
+ "purchases_flutter"
74
+ ],
75
+ "look": [
76
+ "main.dart and the router redirect",
77
+ "the purchaseStream subscription",
78
+ "the paywall widget",
79
+ "ios/Runner/Info.plist"
80
+ ]
81
+ },
82
+ "kotlin": {
83
+ "purchases": [
84
+ "Play Billing Library (BillingClient)",
85
+ "RevenueCat"
86
+ ],
87
+ "look": [
88
+ "MainActivity and the NavHost",
89
+ "PurchasesUpdatedListener and acknowledgePurchase",
90
+ "the paywall composable",
91
+ "AndroidManifest permissions"
92
+ ]
93
+ }
94
+ },
95
+ "items": [
96
+ {
97
+ "id": "ob-permission-on-launch",
98
+ "area": "onboarding",
99
+ "severity": "high",
100
+ "title": "System permission prompt fires on launch, before any context",
101
+ "look": {
102
+ "react-native": "Notifications.requestPermissionsAsync, requestTrackingPermissionsAsync, PermissionsAndroid.request or react-native-permissions request() inside App.tsx, a root useEffect or the first onboarding screen.",
103
+ "swift": "UNUserNotificationCenter.requestAuthorization, ATTrackingManager.requestTrackingAuthorization or CLLocationManager.requestWhenInUseAuthorization in application(_:didFinishLaunchingWithOptions:) or the App init.",
104
+ "flutter": "Permission.notification.request() or FirebaseMessaging.requestPermission() in main() or the first screen initState.",
105
+ "kotlin": "POST_NOTIFICATIONS or location requested from MainActivity.onCreate via registerForActivityResult(RequestPermission()).",
106
+ "swiftui": ".task or .onAppear on the root view calling requestAuthorization before the user has done anything."
107
+ },
108
+ "why": "iOS shows each system prompt once; a reflex \"Don't Allow\" on launch is permanent unless the user digs into Settings. Lost push means no trial-ending reminder and no win-back, which costs renewals.",
109
+ "evidence": "brain:onboarding/perm-system-prompt-on-launch",
110
+ "fix": {
111
+ "stack": "react-native",
112
+ "code": "const askPush = async () => {\n const { status } = await Notifications.getPermissionsAsync()\n if (status !== 'undetermined') return status\n return (await Notifications.requestPermissionsAsync()).status\n}\n\n<Button title=\"Remind me before my trial ends\" onPress={askPush} />"
113
+ }
114
+ },
115
+ {
116
+ "id": "ob-fake-system-primer",
117
+ "area": "onboarding",
118
+ "severity": "medium",
119
+ "title": "Pre-permission primer mimics the system alert or has no way out",
120
+ "look": {
121
+ "react-native": "A custom Modal styled like an iOS alert with \"Allow\"/\"Don't Allow\" buttons, or a primer whose only button triggers the system prompt.",
122
+ "swift": "A custom UIAlertController-lookalike view or primer screen with a single \"Allow\" button before requestAuthorization.",
123
+ "flutter": "A showDialog/CupertinoAlertDialog primer with only an \"Allow\" action before Permission.request().",
124
+ "kotlin": "A Compose AlertDialog primer with only a confirm button before the runtime permission launcher.",
125
+ "swiftui": "A .sheet or custom alert view titled like the system prompt with only one button."
126
+ },
127
+ "why": "Guideline 5.1.1(iv) forbids manipulating or tricking people into consenting; review rejects primers that imitate system UI. A primer without \"Not now\" also burns the one real prompt on people who would have said no.",
128
+ "evidence": "brain:onboarding/perm-fake-system-dialog",
129
+ "fix": {
130
+ "stack": "swiftui",
131
+ "code": "VStack(spacing: 12) {\n Text(\"Get a reminder 2 days before your trial ends\")\n Button(\"Turn on reminders\") { Task { await requestPush() } }\n Button(\"Not now\") { step = .next }\n .buttonStyle(.plain)\n}"
132
+ }
133
+ },
134
+ {
135
+ "id": "ob-forced-account",
136
+ "area": "onboarding",
137
+ "severity": "high",
138
+ "title": "Account creation is required before the user sees any value",
139
+ "look": {
140
+ "react-native": "Initial route is a SignIn/SignUp screen (Stack.Screen order, expo-router (auth) group redirect) when there is no session.",
141
+ "swift": "Root view controller or App body switches to LoginView whenever there is no user.",
142
+ "flutter": "initialRoute or GoRouter redirect sends every logged-out user to /login.",
143
+ "kotlin": "NavHost startDestination is \"login\" or a splash that routes to auth when no account exists."
144
+ },
145
+ "why": "Every gate before value drops users who have not yet decided the app is worth an email. Guideline 5.1.1(v) also says apps without significant account-based features must let people use them without logging in.",
146
+ "evidence": "brain:onboarding/su-forced-account-before-value",
147
+ "fix": {
148
+ "stack": "react-native",
149
+ "code": "export default function Index() {\n const { session, onboarded } = useAuth()\n if (!onboarded) return <Redirect href=\"/onboarding\" />\n return <Redirect href={session ? '/home' : '/home?guest=1'} />\n}"
150
+ }
151
+ },
152
+ {
153
+ "id": "ob-no-progress",
154
+ "area": "onboarding",
155
+ "severity": "low",
156
+ "title": "Multi-step onboarding has no progress indicator",
157
+ "look": {
158
+ "react-native": "An onboarding stack or pager with 5+ screens and no progress bar/step counter component.",
159
+ "swift": "A UIPageViewController or step enum flow with no UIProgressView or step label.",
160
+ "flutter": "A PageView of onboarding steps with no LinearProgressIndicator or step counter.",
161
+ "kotlin": "A HorizontalPager or NavHost onboarding graph with no LinearProgressIndicator.",
162
+ "swiftui": "A TabView(.page) or NavigationStack path for onboarding with no ProgressView(value:)."
163
+ },
164
+ "why": "Without a sense of how long the flow is, people quit at the 3rd or 4th question. Every step lost here never reaches the paywall.",
165
+ "evidence": "brain:onboarding/q-no-progress-indicator",
166
+ "fix": {
167
+ "stack": "flutter",
168
+ "code": "LinearProgressIndicator(\n value: (step + 1) / steps.length,\n minHeight: 4,\n)"
169
+ }
170
+ },
171
+ {
172
+ "id": "ob-no-core-action",
173
+ "area": "onboarding",
174
+ "severity": "medium",
175
+ "title": "The paywall arrives before the user does the core action once",
176
+ "look": {
177
+ "react-native": "Onboarding stack ends with navigate('Paywall') right after info/quiz screens, with no screen that runs the main feature.",
178
+ "swift": "The onboarding coordinator presents the paywall right after intro pages; no step calls the core feature.",
179
+ "flutter": "The last onboarding route pushes /paywall with no screen exercising the core feature.",
180
+ "kotlin": "The onboarding graph navigates to \"paywall\" before any screen that uses the main feature."
181
+ },
182
+ "why": "People pay for something they have felt work. A paywall after only promises converts lower and trials started without an aha moment cancel more.",
183
+ "evidence": "brain:onboarding/vm-no-core-action-before-paywall",
184
+ "fix": {
185
+ "stack": "react-native",
186
+ "code": "const steps = ['goal', 'firstScan', 'result', 'paywall'] as const\n\nfunction next(current: typeof steps[number]) {\n const i = steps.indexOf(current)\n navigation.navigate(steps[i + 1])\n}"
187
+ }
188
+ },
189
+ {
190
+ "id": "ob-explainer-carousel",
191
+ "area": "onboarding",
192
+ "severity": "low",
193
+ "title": "Feature carousel of 3+ explainer slides before anything interactive",
194
+ "look": {
195
+ "react-native": "A FlatList/ScrollView horizontal pager or react-native-onboarding-swiper with static image+text slides.",
196
+ "swift": "UIPageViewController or UICollectionView paging through marketing slides.",
197
+ "flutter": "PageView/introduction_screen slides with image and text only.",
198
+ "kotlin": "HorizontalPager with static feature slides in the first activity.",
199
+ "swiftui": "TabView with .tabViewStyle(.page) over static feature slides."
200
+ },
201
+ "why": "Swipe-through feature tours are skipped or abandoned and teach little. Replace them with one outcome promise and a hands-on first step.",
202
+ "evidence": "brain:onboarding/vm-explainer-screens",
203
+ "fix": {
204
+ "stack": "swiftui",
205
+ "code": "VStack(spacing: 16) {\n Text(\"Fix heel pain in 10 minutes a day\").font(.title2.bold())\n Button(\"Start my first session\") { path.append(Step.firstSession) }\n}"
206
+ }
207
+ },
208
+ {
209
+ "id": "ob-answers-go-nowhere",
210
+ "area": "onboarding",
211
+ "severity": "medium",
212
+ "title": "Quiz answers are collected but never used",
213
+ "look": {
214
+ "react-native": "Onboarding answers saved to state/AsyncStorage but never read by the paywall, plan or home screen (search for the keys).",
215
+ "swift": "Answers stored in UserDefaults or a model that no later view reads.",
216
+ "flutter": "Answers stored in a provider/SharedPreferences with no reader outside onboarding.",
217
+ "kotlin": "Answers saved to DataStore/ViewModel with no consumer after onboarding."
218
+ },
219
+ "why": "Asking questions sets the expectation of a personal plan. If the paywall and home ignore them, the flow is pure friction and the paywall feels generic.",
220
+ "evidence": "brain:onboarding/q-answers-go-nowhere",
221
+ "fix": {
222
+ "stack": "react-native",
223
+ "code": "const { goal } = useOnboardingAnswers()\n\n<Text style={styles.headline}>\n {goal ? `Your plan to ${goal} is ready` : 'Your plan is ready'}\n</Text>"
224
+ }
225
+ },
226
+ {
227
+ "id": "ob-pii-before-value",
228
+ "area": "onboarding",
229
+ "severity": "medium",
230
+ "title": "Name, email, phone or birth date asked before any value",
231
+ "look": {
232
+ "react-native": "TextInput for email/phone/birthdate in the first onboarding screens.",
233
+ "swift": "UITextField with .emailAddress/.telephoneNumber content type in the first steps.",
234
+ "flutter": "TextField with keyboardType emailAddress/phone in the first onboarding routes.",
235
+ "kotlin": "OutlinedTextField with KeyboardType.Email/Phone in the first onboarding screens."
236
+ },
237
+ "why": "Personal fields early are the steepest drop in most flows. Guideline 5.1.1 also asks apps not to require personal information unless it is directly relevant to core functionality.",
238
+ "evidence": "brain:onboarding/q-pii-before-value",
239
+ "fix": {
240
+ "stack": "kotlin",
241
+ "code": "val steps = listOf(\n Step.Goal,\n Step.FirstResult,\n Step.Paywall,\n Step.SaveProgressEmail\n)"
242
+ }
243
+ },
244
+ {
245
+ "id": "ob-rating-prompt-in-onboarding",
246
+ "area": "onboarding",
247
+ "severity": "medium",
248
+ "title": "Review prompt during onboarding, before any experience",
249
+ "look": {
250
+ "react-native": "StoreReview.requestReview() (expo-store-review) or react-native-rate called from onboarding screens.",
251
+ "swift": "SKStoreReviewController.requestReview / AppStore.requestReview(in:) during onboarding.",
252
+ "flutter": "InAppReview.instance.requestReview() in onboarding.",
253
+ "kotlin": "ReviewManager.launchReviewFlow during onboarding.",
254
+ "swiftui": "@Environment(\\.requestReview) called in an onboarding view."
255
+ },
256
+ "why": "iOS shows the prompt at most 3 times a year, so spending one on a user who has seen nothing yields fewer and worse ratings. Ask after a success moment.",
257
+ "evidence": "brain:onboarding/ppw-rating-prompt-in-onboarding",
258
+ "fix": {
259
+ "stack": "swiftui",
260
+ "code": "@Environment(\\.requestReview) private var requestReview\n\nfunc sessionCompleted(count: Int) {\n if count == 3 { requestReview() }\n}"
261
+ }
262
+ },
263
+ {
264
+ "id": "ob-replays-after-update",
265
+ "area": "onboarding",
266
+ "severity": "medium",
267
+ "title": "Onboarding shows again for returning or paying users",
268
+ "look": {
269
+ "react-native": "The \"onboarded\" flag kept only in React state/zustand without persistence, or keyed to the app version.",
270
+ "swift": "The completion flag stored in memory or keyed by CFBundleShortVersionString.",
271
+ "flutter": "The flag held in a provider without SharedPreferences, or keyed by version.",
272
+ "kotlin": "The flag kept in a ViewModel only, or cleared on app update."
273
+ },
274
+ "why": "Paying users dropped into onboarding and a paywall again feel scammed and ask for refunds. Persist the flag and also skip onboarding when an active entitlement exists.",
275
+ "evidence": "brain:audit/ob-replays-after-update",
276
+ "fix": {
277
+ "stack": "react-native",
278
+ "code": "const [done, setDone] = useMMKVBoolean('onboarding.done')\nconst { isPro } = useEntitlement()\n\nif (!done && !isPro) return <Onboarding onFinish={() => setDone(true)} />\nreturn <Home />"
279
+ }
280
+ },
281
+ {
282
+ "id": "ob-no-step-analytics",
283
+ "area": "onboarding",
284
+ "severity": "low",
285
+ "title": "No analytics event per onboarding step",
286
+ "look": {
287
+ "react-native": "Onboarding screens with no track()/logEvent call on view or answer.",
288
+ "swift": "Onboarding view controllers with no analytics call in viewDidAppear or on answer.",
289
+ "flutter": "Onboarding widgets with no analytics.logEvent per step.",
290
+ "kotlin": "Onboarding composables with no event logged per step."
291
+ },
292
+ "why": "Without a step funnel you cannot see where people drop, so every onboarding change is a guess and price/flow tests cannot be read.",
293
+ "evidence": "brain:audit/ob-no-step-analytics",
294
+ "fix": {
295
+ "stack": "flutter",
296
+ "code": "@override\nvoid initState() {\n super.initState();\n analytics.logEvent(name: 'onboarding_step', parameters: {'step': widget.step, 'index': widget.index});\n}"
297
+ }
298
+ },
299
+ {
300
+ "id": "ob-slow-first-screen",
301
+ "area": "onboarding",
302
+ "severity": "low",
303
+ "title": "Long splash or brand animation before the first screen",
304
+ "look": {
305
+ "react-native": "expo-splash-screen preventAutoHideAsync held until a Lottie finishes, or setTimeout delays of 2s+ before navigation.",
306
+ "swift": "A launch animation view controller with asyncAfter delays before showing the first screen.",
307
+ "flutter": "Future.delayed of 2s+ or a Lottie splash before runApp content.",
308
+ "kotlin": "SplashScreen setKeepOnScreenCondition held by animation or delay."
309
+ },
310
+ "why": "Every second before the first interactive screen loses first-launch users, and the reviewer's first impression is waiting. Hide the splash as soon as the first screen can render.",
311
+ "evidence": "brain:onboarding/fs-slow-brand-animation",
312
+ "fix": {
313
+ "stack": "react-native",
314
+ "code": "useEffect(() => {\n if (fontsLoaded) SplashScreen.hideAsync()\n}, [fontsLoaded])"
315
+ }
316
+ },
317
+ {
318
+ "id": "pw-hardcoded-price",
319
+ "area": "paywall",
320
+ "severity": "high",
321
+ "title": "Prices are hardcoded strings instead of the store's localized price",
322
+ "look": {
323
+ "react-native": "Literal \"$4.99\", \"9.99\", \"/month\" in paywall JSX instead of product.priceString (react-native-purchases) or product.displayPrice/localizedPrice (expo-iap, react-native-iap).",
324
+ "swift": "String literals with currency instead of Product.displayPrice (StoreKit 2) or SKProduct.price with priceLocale.",
325
+ "flutter": "Literal prices instead of ProductDetails.price (in_app_purchase) or StoreProduct.priceString (purchases_flutter).",
326
+ "kotlin": "Literal prices instead of pricingPhase.formattedPrice from ProductDetails.subscriptionOfferDetails."
327
+ },
328
+ "why": "Users outside the US see the wrong currency and amount, which breaks 3.1.2(c) (describe what you get for the price) and leads to rejections, refunds and chargebacks. It also makes price tests impossible.",
329
+ "evidence": "brain:onboarding/pl-hardcoded-price",
330
+ "fix": {
331
+ "stack": "react-native",
332
+ "code": "const offering = (await Purchases.getOfferings()).current\nconst annual = offering?.annual\n\n<Text style={styles.price}>{annual?.product.priceString} / year</Text>"
333
+ }
334
+ },
335
+ {
336
+ "id": "pw-billed-not-dominant",
337
+ "area": "paywall",
338
+ "severity": "high",
339
+ "title": "A per-week or per-day equivalent is bigger than the amount actually billed",
340
+ "look": {
341
+ "react-native": "Paywall styles where the \"per week\"/\"per day\" Text has a larger fontSize than the billed annual price.",
342
+ "swift": "A large label with a computed weekly price and a small or secondary billed price.",
343
+ "flutter": "A large Text with a weekly breakdown and a small billed price.",
344
+ "kotlin": "A large Text with a weekly equivalent and the billed price in a caption."
345
+ },
346
+ "why": "Apple review rejects under 3.1.2 when the billed amount is not the most prominent pricing element. Users who feel misled refund and leave 1-star reviews.",
347
+ "evidence": "brain:onboarding/pl-billed-amount-not-dominant",
348
+ "fix": {
349
+ "stack": "swiftui",
350
+ "code": "VStack(alignment: .leading) {\n Text(\"\\(product.displayPrice) per year\").font(.title3.bold())\n Text(\"≈ \\(weekly) per week\").font(.footnote).foregroundStyle(.secondary)\n}"
351
+ }
352
+ },
353
+ {
354
+ "id": "pw-missing-terms",
355
+ "area": "paywall",
356
+ "severity": "high",
357
+ "title": "No Terms of Use, Privacy Policy, length or renewal terms near the buy button",
358
+ "look": {
359
+ "react-native": "Paywall screen with no Linking.openURL to terms/privacy and no \"renews automatically\" text.",
360
+ "swift": "No links to a Terms of Use (EULA) and Privacy Policy and no subscription length on the paywall.",
361
+ "flutter": "No url_launcher links to terms/privacy on the paywall.",
362
+ "kotlin": "No terms/privacy links and no renewal text on the paywall."
363
+ },
364
+ "why": "Guideline 3.1.2 and the Developer Program License Agreement require the subscription title, length, price and functional links to the privacy policy and Terms of Use in the app. Missing them is a top paywall rejection.",
365
+ "evidence": "brain:onboarding/pl-missing-required-terms",
366
+ "fix": {
367
+ "stack": "react-native",
368
+ "code": "<Text style={styles.legal}>\n {annual.product.priceString}/year, renews automatically until cancelled in Settings.\n</Text>\n<View style={styles.links}>\n <Text onPress={() => Linking.openURL(TERMS_URL)}>Terms of Use</Text>\n <Text onPress={() => Linking.openURL(PRIVACY_URL)}>Privacy Policy</Text>\n</View>"
369
+ }
370
+ },
371
+ {
372
+ "id": "pw-no-restore",
373
+ "area": "paywall",
374
+ "severity": "high",
375
+ "title": "No visible Restore Purchases control on the paywall",
376
+ "look": {
377
+ "react-native": "Paywall without a button calling Purchases.restorePurchases() or getAvailablePurchases().",
378
+ "swift": "Paywall without a button calling AppStore.sync() or SKPaymentQueue.restoreCompletedTransactions().",
379
+ "flutter": "Paywall without a button calling InAppPurchase.instance.restorePurchases() or Purchases.restorePurchases().",
380
+ "kotlin": "Paywall without a restore action re-querying queryPurchasesAsync.",
381
+ "swiftui": "No restore button; StoreKit views can add .storeButton(.visible, for: .restorePurchases)."
382
+ },
383
+ "why": "Guideline 3.1.1 expects a restore mechanism for restorable purchases and reviewers look for it on the paywall. Paying users on a new phone who cannot restore pay twice or refund.",
384
+ "evidence": "brain:audit/pw-no-restore",
385
+ "fix": {
386
+ "stack": "swiftui",
387
+ "code": "Button(\"Restore Purchases\") {\n Task {\n try? await AppStore.sync()\n await entitlements.refresh()\n }\n}\n.font(.footnote)"
388
+ }
389
+ },
390
+ {
391
+ "id": "pw-trial-unclear",
392
+ "area": "paywall",
393
+ "severity": "high",
394
+ "title": "Trial is shown as \"Free\" without what happens after it ends",
395
+ "look": {
396
+ "react-native": "CTA text like \"Start free trial\"/\"Try for free\" with no \"then {price}/year after N days\" next to it.",
397
+ "swift": "Trial CTA without product.subscription?.introductoryOffer period and the price after it.",
398
+ "flutter": "A \"Try free\" CTA without the post-trial price and date.",
399
+ "kotlin": "A free-trial CTA without the recurring pricingPhase and its period."
400
+ },
401
+ "why": "Under 3.1.2 the trial length, what is charged and when must be clear. Unclear trials drive refunds, chargebacks and \"scam\" reviews, and they get flagged in review.",
402
+ "evidence": "brain:onboarding/pl-trial-shouts-price-whispers",
403
+ "fix": {
404
+ "stack": "react-native",
405
+ "code": "const intro = annual.product.introPrice\n\n<Text>\n {intro\n ? `${intro.periodNumberOfUnits} days free, then ${annual.product.priceString}/year`\n : `${annual.product.priceString}/year`}\n</Text>"
406
+ }
407
+ },
408
+ {
409
+ "id": "pw-trial-eligibility",
410
+ "area": "paywall",
411
+ "severity": "medium",
412
+ "title": "Trial copy is shown to users who are not eligible for it",
413
+ "look": {
414
+ "react-native": "Trial text shown unconditionally; no Purchases.checkTrialOrIntroductoryPriceEligibility call.",
415
+ "swift": "No Product.SubscriptionInfo.isEligibleForIntroOffer check before showing trial copy.",
416
+ "flutter": "No eligibility check (purchases_flutter checkTrialOrIntroductoryPriceEligibility) before trial copy.",
417
+ "kotlin": "Trial text shown when the free-trial offer is missing from subscriptionOfferDetails for this user."
418
+ },
419
+ "why": "A returning user promised \"7 days free\" is charged immediately on purchase. That becomes a refund, a chargeback and a misleading-pricing review complaint.",
420
+ "evidence": "brain:audit/pw-trial-eligibility",
421
+ "fix": {
422
+ "stack": "swift",
423
+ "code": "let eligible = await product.subscription?.isEligibleForIntroOffer ?? false\nctaTitle = eligible && product.subscription?.introductoryOffer != nil\n ? \"Start free trial\"\n : \"Subscribe for \\(product.displayPrice)\""
424
+ }
425
+ },
426
+ {
427
+ "id": "pw-no-load-error-state",
428
+ "area": "paywall",
429
+ "severity": "high",
430
+ "title": "Paywall renders blank or broken when products fail to load",
431
+ "look": {
432
+ "react-native": "Paywall maps offering?.availablePackages without a loading, empty and retry state; prices render as undefined.",
433
+ "swift": "Paywall assumes Product.products(for:) returns all ids; empty array shows an empty screen.",
434
+ "flutter": "Paywall shows nothing when queryProductDetails returns notFoundIDs or an error.",
435
+ "kotlin": "Paywall shows nothing when queryProductDetailsAsync returns an empty list."
436
+ },
437
+ "why": "App Review often tests on a fresh sandbox account and rejects under 2.1 when the purchase UI never loads. Real users offline or in a new storefront hit the same dead end.",
438
+ "evidence": "brain:audit/pw-no-load-error-state",
439
+ "fix": {
440
+ "stack": "flutter",
441
+ "code": "final response = await InAppPurchase.instance.queryProductDetails(ids);\nif (response.productDetails.isEmpty) {\n return ErrorView(\n message: 'Could not load prices',\n onRetry: loadProducts,\n );\n}"
442
+ }
443
+ },
444
+ {
445
+ "id": "pw-price-mismatch",
446
+ "area": "paywall",
447
+ "severity": "medium",
448
+ "title": "Prices or discounts in onboarding copy differ from the paywall",
449
+ "look": {
450
+ "react-native": "Onboarding or marketing screens with literal prices/percentages (\"Save 60%\") that are not computed from store products.",
451
+ "swift": "Hardcoded \"Save X%\" or prices in onboarding strings files.",
452
+ "flutter": "Hardcoded discount strings in ARB/l10n files.",
453
+ "kotlin": "Hardcoded discount strings in strings.xml."
454
+ },
455
+ "why": "A number that changes between screens reads as a bait-and-switch and invites misleading-pricing complaints under 3.1.2. Compute savings from the actual products.",
456
+ "evidence": "brain:onboarding/price-mismatch-across-screens",
457
+ "fix": {
458
+ "stack": "kotlin",
459
+ "code": "val annual = annualPhase.priceAmountMicros\nval monthly = monthlyPhase.priceAmountMicros\nval save = 100 - (annual * 100 / (monthly * 12))\nText(\"Save $save%\")"
460
+ }
461
+ },
462
+ {
463
+ "id": "pw-ignores-answers",
464
+ "area": "paywall",
465
+ "severity": "low",
466
+ "title": "Paywall is identical regardless of onboarding answers",
467
+ "look": {
468
+ "react-native": "Paywall component reads no onboarding state; same headline for everyone.",
469
+ "swift": "Paywall view with no input from the onboarding model.",
470
+ "flutter": "Paywall widget with no reference to onboarding answers.",
471
+ "kotlin": "Paywall composable without onboarding state params."
472
+ },
473
+ "why": "A paywall that restates the user's own goal converts better than a generic feature list, and the answers have already been paid for in drop-off.",
474
+ "evidence": "brain:onboarding/p-paywall-ignores-answers",
475
+ "fix": {
476
+ "stack": "react-native",
477
+ "code": "<Paywall headline={`Reach ${answers.goal} by ${planEndDate}`} />"
478
+ }
479
+ },
480
+ {
481
+ "id": "pw-no-payment-due-now",
482
+ "area": "paywall",
483
+ "severity": "low",
484
+ "title": "Trial CTA has no \"No payment due now\" reassurance",
485
+ "look": {
486
+ "react-native": "Trial CTA area without a line like \"No payment now. Cancel anytime in Settings.\"",
487
+ "swift": "Same in the trial CTA area.",
488
+ "flutter": "Same in the trial CTA area.",
489
+ "kotlin": "Same in the trial CTA area."
490
+ },
491
+ "why": "Fear of being charged is the main objection at a trial paywall. One honest line under the button lifts trial starts without hiding terms.",
492
+ "evidence": "brain:onboarding/pl-no-payment-due-now",
493
+ "fix": {
494
+ "stack": "swiftui",
495
+ "code": "VStack(spacing: 6) {\n Button(\"Start 7-day free trial\", action: buy)\n Text(\"No payment now. Cancel anytime in Settings.\")\n .font(.caption).foregroundStyle(.secondary)\n}"
496
+ }
497
+ },
498
+ {
499
+ "id": "pw-fake-discount",
500
+ "area": "paywall",
501
+ "severity": "medium",
502
+ "title": "Strikethrough prices or countdowns with no real basis",
503
+ "look": {
504
+ "react-native": "Hardcoded strikethrough (textDecorationLine: line-through) prices or a countdown that restarts on each open.",
505
+ "swift": "A strikethrough attributed string with a made-up price, or a timer reset in viewDidAppear.",
506
+ "flutter": "TextDecoration.lineThrough with a literal price, or a timer that resets per open.",
507
+ "kotlin": "TextDecoration.LineThrough with a literal price, or a countdown not persisted."
508
+ },
509
+ "why": "Evergreen \"70% off\" and resetting timers are misleading under 3.1.2 and consumer law, and users who notice them stop trusting the price.",
510
+ "evidence": "brain:onboarding/pp-evergreen-fake-discount",
511
+ "fix": {
512
+ "stack": "react-native",
513
+ "code": "const monthly = offering.monthly.product.price\nconst annual = offering.annual.product.price\n\n<Text style={styles.strike}>{format(monthly * 12)}</Text>\n<Text>{offering.annual.product.priceString}</Text>"
514
+ }
515
+ },
516
+ {
517
+ "id": "pw-generic-cta",
518
+ "area": "paywall",
519
+ "severity": "low",
520
+ "title": "Buy button says \"Continue\" instead of the deal",
521
+ "look": {
522
+ "react-native": "Primary paywall button title \"Continue\"/\"Next\".",
523
+ "swift": "Primary paywall button \"Continue\".",
524
+ "flutter": "Primary paywall button \"Continue\".",
525
+ "kotlin": "Primary paywall button \"Continue\"."
526
+ },
527
+ "why": "A CTA that does not say what happens (trial or charge) is less clear to users and reviewers. Saying the deal on the button lifts conversion and avoids confusion.",
528
+ "evidence": "brain:onboarding/cta-states-the-deal",
529
+ "fix": {
530
+ "stack": "flutter",
531
+ "code": "FilledButton(\n onPressed: buy,\n child: Text(eligible ? 'Start 7-day free trial' : 'Subscribe for ${product.price}/year'),\n)"
532
+ }
533
+ },
534
+ {
535
+ "id": "pu-no-transaction-listener",
536
+ "area": "purchase",
537
+ "severity": "high",
538
+ "title": "Transactions made outside the purchase call are never observed",
539
+ "look": {
540
+ "react-native": "Purchases.configure called late (on the paywall) instead of at app start; react-native-iap purchaseUpdatedListener not registered at the root.",
541
+ "swift": "No Task { for await update in Transaction.updates } started at launch; SKPaymentTransactionObserver added late.",
542
+ "flutter": "InAppPurchase.instance.purchaseStream not subscribed in main() or the root widget.",
543
+ "kotlin": "No PurchasesUpdatedListener on the BillingClient and no queryPurchasesAsync on resume.",
544
+ "swiftui": "No .task at the App level iterating Transaction.updates."
545
+ },
546
+ "why": "Renewals, Ask to Buy approvals, offer-code redemptions and interrupted purchases arrive outside the buy call. Missing them leaves paying users locked out and support tickets open.",
547
+ "evidence": "brain:audit/pu-no-transaction-listener",
548
+ "fix": {
549
+ "stack": "swift",
550
+ "code": "func listenForTransactions() -> Task<Void, Never> {\n Task.detached {\n for await result in Transaction.updates {\n guard case .verified(let transaction) = result else { continue }\n await Entitlements.shared.refresh()\n await transaction.finish()\n }\n }\n}"
551
+ }
552
+ },
553
+ {
554
+ "id": "pu-not-finished",
555
+ "area": "purchase",
556
+ "severity": "high",
557
+ "title": "Purchases are not finished or acknowledged",
558
+ "look": {
559
+ "react-native": "react-native-iap requestPurchase without finishTransaction({ purchase, isConsumable }).",
560
+ "swift": "StoreKit 2 transaction.finish() missing after delivery; StoreKit 1 finishTransaction missing.",
561
+ "flutter": "completePurchase not called when purchaseDetails.pendingCompletePurchase is true.",
562
+ "kotlin": "acknowledgePurchase (or consumeAsync) never called for PURCHASED purchases."
563
+ },
564
+ "why": "Google Play refunds purchases not acknowledged within 3 days. On iOS unfinished transactions are redelivered at every launch, which double-grants consumables and confuses entitlement code.",
565
+ "evidence": "brain:audit/pu-not-finished",
566
+ "fix": {
567
+ "stack": "kotlin",
568
+ "code": "if (purchase.purchaseState == Purchase.PurchaseState.PURCHASED && !purchase.isAcknowledged) {\n val params = AcknowledgePurchaseParams.newBuilder()\n .setPurchaseToken(purchase.purchaseToken)\n .build()\n billingClient.acknowledgePurchase(params) { grantEntitlement(purchase) }\n}"
569
+ }
570
+ },
571
+ {
572
+ "id": "pu-cancel-as-error",
573
+ "area": "purchase",
574
+ "severity": "medium",
575
+ "title": "User cancelling the purchase sheet shows an error",
576
+ "look": {
577
+ "react-native": "catch block alerts on every error without checking e.userCancelled (react-native-purchases) or E_USER_CANCELLED.",
578
+ "swift": ".userCancelled result of product.purchase() handled like a failure.",
579
+ "flutter": "PurchaseStatus.canceled handled as an error.",
580
+ "kotlin": "BillingResponseCode.USER_CANCELED shown as an error."
581
+ },
582
+ "why": "An error alert after a deliberate cancel feels broken and pushes away users who might come back to the paywall. Treat cancel as a silent return.",
583
+ "evidence": "brain:audit/pu-cancel-as-error",
584
+ "fix": {
585
+ "stack": "react-native",
586
+ "code": "try {\n await Purchases.purchasePackage(pkg)\n} catch (e: any) {\n if (e.userCancelled) return\n Alert.alert('Purchase failed', e.message)\n}"
587
+ }
588
+ },
589
+ {
590
+ "id": "pu-pending-mishandled",
591
+ "area": "purchase",
592
+ "severity": "medium",
593
+ "title": "Pending purchases (Ask to Buy, slow payment) are treated as success or failure",
594
+ "look": {
595
+ "react-native": "No handling for PENDING state; premium granted as soon as requestPurchase resolves.",
596
+ "swift": ".pending result of product.purchase() ignored or treated as failure.",
597
+ "flutter": "PurchaseStatus.pending not handled.",
598
+ "kotlin": "Purchase.PurchaseState.PENDING granted as purchased."
599
+ },
600
+ "why": "Granting on pending gives away paid features when the payment never completes; failing it tells a child or a slow-payment user to buy again. Show a pending state and wait for the update.",
601
+ "evidence": "brain:audit/pu-pending-mishandled",
602
+ "fix": {
603
+ "stack": "swift",
604
+ "code": "switch try await product.purchase() {\ncase .success(let result):\n if case .verified(let t) = result { await grant(t); await t.finish() }\ncase .pending:\n state = .awaitingApproval\ncase .userCancelled:\n break\n@unknown default:\n break\n}"
605
+ }
606
+ },
607
+ {
608
+ "id": "pu-local-entitlement-flag",
609
+ "area": "purchase",
610
+ "severity": "high",
611
+ "title": "Premium is a local boolean set at purchase and never re-checked",
612
+ "look": {
613
+ "react-native": "AsyncStorage/MMKV \"isPro\" set after purchase instead of customerInfo.entitlements.active.",
614
+ "swift": "UserDefaults \"isPremium\" instead of Transaction.currentEntitlements.",
615
+ "flutter": "SharedPreferences \"isPro\" instead of the purchase stream or CustomerInfo.",
616
+ "kotlin": "SharedPreferences/DataStore flag instead of queryPurchasesAsync."
617
+ },
618
+ "why": "Expired, refunded and cancelled users keep access, while paying users lose it after reinstall or on a second device. Both cost money.",
619
+ "evidence": "brain:audit/pu-local-entitlement-flag",
620
+ "fix": {
621
+ "stack": "swift",
622
+ "code": "func refresh() async {\n var active = false\n for await result in Transaction.currentEntitlements {\n if case .verified(let t) = result, t.revocationDate == nil { active = true }\n }\n isPro = active\n}"
623
+ }
624
+ },
625
+ {
626
+ "id": "pu-restore-broken",
627
+ "area": "purchase",
628
+ "severity": "high",
629
+ "title": "Restore runs but the app does not update entitlements",
630
+ "look": {
631
+ "react-native": "restorePurchases() result ignored; UI still shows the paywall.",
632
+ "swift": "AppStore.sync() called but currentEntitlements not re-read.",
633
+ "flutter": "restorePurchases() called but restored events on purchaseStream not handled.",
634
+ "kotlin": "No re-query of queryPurchasesAsync after a restore tap."
635
+ },
636
+ "why": "Guideline 3.1.1 requires a working restore mechanism; reviewers test it. A restore that silently does nothing makes paying users buy again or refund.",
637
+ "evidence": "brain:audit/pu-restore-broken",
638
+ "fix": {
639
+ "stack": "react-native",
640
+ "code": "const restore = async () => {\n const info = await Purchases.restorePurchases()\n if (info.entitlements.active.pro) return navigation.goBack()\n Alert.alert('Nothing to restore', 'No active subscription on this Apple ID.')\n}"
641
+ }
642
+ },
643
+ {
644
+ "id": "pu-no-server-validation",
645
+ "area": "purchase",
646
+ "severity": "medium",
647
+ "title": "Server unlocks paid content based on a client claim",
648
+ "look": {
649
+ "react-native": "API calls sending { isPro: true } or a plan name from the app to unlock server features.",
650
+ "swift": "Backend trusts a flag from the app instead of App Store Server API or signed transactions.",
651
+ "flutter": "Backend trusts an isPro field from the app.",
652
+ "kotlin": "Backend trusts a client flag instead of Google Play Developer API verification."
653
+ },
654
+ "why": "Anyone can flip the flag with a proxy and get paid features for free. Verify on the server with the App Store Server API, the Play Developer API or a provider webhook.",
655
+ "evidence": "brain:audit/pu-no-server-validation",
656
+ "fix": {
657
+ "stack": "kotlin",
658
+ "code": "val token = purchase.purchaseToken\napi.verifyPurchase(VerifyRequest(productId, token))\nentitlements.refresh()"
659
+ }
660
+ },
661
+ {
662
+ "id": "pu-refund-ignored",
663
+ "area": "purchase",
664
+ "severity": "medium",
665
+ "title": "Refunds and revocations are not handled",
666
+ "look": {
667
+ "react-native": "No CustomerInfo listener (addCustomerInfoUpdateListener) to drop access.",
668
+ "swift": "transaction.revocationDate never checked.",
669
+ "flutter": "No handling of expired or revoked entitlements after restore.",
670
+ "kotlin": "Voided purchases never removed (no server check with the Voided Purchases API)."
671
+ },
672
+ "why": "Refunded users keep premium indefinitely, which turns refund requests into a free-access trick.",
673
+ "evidence": "brain:audit/pu-refund-ignored",
674
+ "fix": {
675
+ "stack": "react-native",
676
+ "code": "useEffect(() => {\n const listener = (info: CustomerInfo) => setPro(Boolean(info.entitlements.active.pro))\n Purchases.addCustomerInfoUpdateListener(listener)\n return () => Purchases.removeCustomerInfoUpdateListener(listener)\n}, [])"
677
+ }
678
+ },
679
+ {
680
+ "id": "pu-double-tap",
681
+ "area": "purchase",
682
+ "severity": "low",
683
+ "title": "Buy button stays enabled while a purchase is in flight",
684
+ "look": {
685
+ "react-native": "Purchase button without a loading/disabled state around purchasePackage.",
686
+ "swift": "Button not disabled while awaiting product.purchase().",
687
+ "flutter": "Button onPressed not nulled while buying.",
688
+ "kotlin": "Button enabled while launchBillingFlow is pending."
689
+ },
690
+ "why": "Double taps open two purchase sheets or race the entitlement update, producing errors that make users give up.",
691
+ "evidence": "brain:audit/pu-double-tap",
692
+ "fix": {
693
+ "stack": "flutter",
694
+ "code": "FilledButton(\n onPressed: buying ? null : () async {\n setState(() => buying = true);\n try { await buy(); } finally { if (mounted) setState(() => buying = false); }\n },\n child: buying ? const CircularProgressIndicator() : const Text('Subscribe'),\n)"
695
+ }
696
+ },
697
+ {
698
+ "id": "pu-products-late",
699
+ "area": "purchase",
700
+ "severity": "low",
701
+ "title": "Products are fetched only when the paywall opens",
702
+ "look": {
703
+ "react-native": "getOfferings()/getProducts() first called inside the paywall useEffect.",
704
+ "swift": "Product.products(for:) called in the paywall onAppear only.",
705
+ "flutter": "queryProductDetails called only in the paywall initState.",
706
+ "kotlin": "queryProductDetailsAsync called only when the paywall opens."
707
+ },
708
+ "why": "A spinner at the decision moment costs conversions; prefetch at launch so prices render instantly.",
709
+ "evidence": "brain:audit/pu-products-late",
710
+ "fix": {
711
+ "stack": "swiftui",
712
+ "code": "@main struct App: SwiftUI.App {\n @State private var store = Store()\n var body: some Scene {\n WindowGroup { RootView().environment(store).task { await store.loadProducts() } }\n }\n}"
713
+ }
714
+ },
715
+ {
716
+ "id": "pu-user-id-mismatch",
717
+ "area": "purchase",
718
+ "severity": "medium",
719
+ "title": "Purchases are tied to an anonymous id that changes or never links to the account",
720
+ "look": {
721
+ "react-native": "Purchases.configure without logIn(userId) after sign-in, or a new random appUserID per install.",
722
+ "swift": "No appAccountToken on purchase and no mapping to the signed-in account.",
723
+ "flutter": "Purchases.logIn missing after authentication.",
724
+ "kotlin": "No obfuscatedAccountId on BillingFlowParams and no mapping to the account."
725
+ },
726
+ "why": "Guideline 3.1.2(a) expects a subscription to be available on all of the user's devices. Purchases stranded on an anonymous id look like lost subscriptions and become refunds.",
727
+ "evidence": "brain:audit/pu-user-id-mismatch",
728
+ "fix": {
729
+ "stack": "react-native",
730
+ "code": "onAuthStateChanged(auth, async (user) => {\n if (user) await Purchases.logIn(user.uid)\n else await Purchases.logOut()\n})"
731
+ }
732
+ },
733
+ {
734
+ "id": "pu-debug-unlock",
735
+ "area": "purchase",
736
+ "severity": "high",
737
+ "title": "A debug or test unlock is reachable in release builds",
738
+ "look": {
739
+ "react-native": "isPro forced true behind a flag not guarded by __DEV__, a hidden tap gesture, or a \"promo\" string compare.",
740
+ "swift": "Premium override not wrapped in #if DEBUG, or a hidden settings toggle.",
741
+ "flutter": "kDebugMode not checked around a premium override.",
742
+ "kotlin": "BuildConfig.DEBUG not checked around a premium override."
743
+ },
744
+ "why": "Hidden unlocks leak on social media and give paid features away. Guideline 2.3.1 also forbids hidden or undocumented features.",
745
+ "evidence": "brain:audit/pu-debug-unlock",
746
+ "fix": {
747
+ "stack": "swift",
748
+ "code": "var isPro: Bool {\n #if DEBUG\n if ProcessInfo.processInfo.environment[\"FORCE_PRO\"] == \"1\" { return true }\n #endif\n return entitlements.isActive\n}"
749
+ }
750
+ },
751
+ {
752
+ "id": "ar-external-purchase",
753
+ "area": "apple-rule",
754
+ "severity": "high",
755
+ "title": "Digital features sold through a web checkout link inside the iOS app",
756
+ "look": {
757
+ "react-native": "Linking.openURL to Stripe/Paddle/web checkout or \"Buy on our website\" buttons on iOS.",
758
+ "swift": "SFSafariViewController/openURL to a web checkout for in-app features.",
759
+ "flutter": "url_launcher to a web checkout for unlocking features on iOS.",
760
+ "kotlin": "n/a on Google Play; check Play's payments policy for alternative billing."
761
+ },
762
+ "why": "Guideline 3.1.1 requires In-App Purchase to unlock features or content. External purchase links are allowed only on the US storefront (3.1.1(a)) or with an Apple External Purchase entitlement in eligible regions; elsewhere they are a rejection.",
763
+ "evidence": "brain:onboarding/pl-pay-on-web-beside-iap",
764
+ "fix": {
765
+ "stack": "react-native",
766
+ "code": "const showWebCheckout = Platform.OS !== 'ios' || storefront === 'USA'\n\n{showWebCheckout && <Button title=\"Pay on the web\" onPress={openCheckout} />}\n<Button title=\"Subscribe\" onPress={() => Purchases.purchasePackage(pkg)} />"
767
+ }
768
+ },
769
+ {
770
+ "id": "ar-restore-required",
771
+ "area": "apple-rule",
772
+ "severity": "high",
773
+ "title": "Restorable purchases have no restore mechanism anywhere",
774
+ "look": {
775
+ "react-native": "No call to restorePurchases()/getAvailablePurchases() anywhere in the codebase.",
776
+ "swift": "No AppStore.sync() or restoreCompletedTransactions() anywhere.",
777
+ "flutter": "No restorePurchases() anywhere.",
778
+ "kotlin": "No purchase re-query on reinstall."
779
+ },
780
+ "why": "Guideline 3.1.1 expects a restore mechanism for restorable in-app purchases (non-consumables and subscriptions). It is one of the most common subscription app rejections.",
781
+ "evidence": "brain:audit/ar-restore-required",
782
+ "fix": {
783
+ "stack": "swift",
784
+ "code": "Button(\"Restore Purchases\") {\n Task { try? await AppStore.sync() }\n}"
785
+ }
786
+ },
787
+ {
788
+ "id": "ar-unlock-codes",
789
+ "area": "apple-rule",
790
+ "severity": "medium",
791
+ "title": "Features unlocked with your own license keys, QR codes or promo codes",
792
+ "look": {
793
+ "react-native": "A text field that compares a code against a list or your API to set isPro.",
794
+ "swift": "A redeem-code field validated by your backend that grants premium.",
795
+ "flutter": "A promo-code field that grants premium without IAP.",
796
+ "kotlin": "n/a for Play policy beyond its own rules; check anyway on iOS builds."
797
+ },
798
+ "why": "Guideline 3.1.1: apps may not use their own mechanisms such as license keys, QR codes or promo codes to unlock content. Use App Store offer codes instead (presentOfferCodeRedeemSheet).",
799
+ "evidence": "brain:audit/ar-unlock-codes",
800
+ "fix": {
801
+ "stack": "swiftui",
802
+ "code": "Button(\"Redeem code\") { showRedeem = true }\n .offerCodeRedemption(isPresented: $showRedeem) { result in\n Task { await entitlements.refresh() }\n }"
803
+ }
804
+ },
805
+ {
806
+ "id": "ar-trial-toggle",
807
+ "area": "apple-rule",
808
+ "severity": "high",
809
+ "title": "A \"free trial\" toggle that switches between plans",
810
+ "look": {
811
+ "react-native": "A Switch labelled \"Enable free trial\" that swaps the selected package.",
812
+ "swift": "A Toggle that changes the product between a trial and a non-trial plan.",
813
+ "flutter": "A Switch that swaps products for a trial.",
814
+ "kotlin": "A Switch that swaps base plans for a trial offer."
815
+ },
816
+ "why": "Apple has been rejecting trial toggles on paywalls since 2024 under 3.1.2 as confusing about what will be charged. Show plans with their trial terms instead.",
817
+ "evidence": "brain:onboarding/tr-trial-toggle",
818
+ "fix": {
819
+ "stack": "react-native",
820
+ "code": "{packages.map((p) => (\n <PlanRow\n key={p.identifier}\n selected={p === selected}\n title={p.product.title}\n terms={termsFor(p)}\n onPress={() => setSelected(p)}\n />\n))}"
821
+ }
822
+ },
823
+ {
824
+ "id": "ar-cross-device",
825
+ "area": "apple-rule",
826
+ "severity": "medium",
827
+ "title": "Subscription only works on the device it was bought on",
828
+ "look": {
829
+ "react-native": "Entitlement stored per device with no restore or account sync.",
830
+ "swift": "Entitlement stored in UserDefaults or the keychain only.",
831
+ "flutter": "Entitlement saved locally only.",
832
+ "kotlin": "Entitlement saved locally only."
833
+ },
834
+ "why": "Guideline 3.1.2(a) requires auto-renewable subscriptions to be available on all of the user's devices. Read entitlements from StoreKit or your server.",
835
+ "evidence": "brain:audit/ar-cross-device",
836
+ "fix": {
837
+ "stack": "swift",
838
+ "code": "for await result in Transaction.currentEntitlements {\n if case .verified(let t) = result, t.productType == .autoRenewable { isPro = true }\n}"
839
+ }
840
+ },
841
+ {
842
+ "id": "ar-account-deletion",
843
+ "area": "apple-rule",
844
+ "severity": "high",
845
+ "title": "Account creation without in-app account deletion",
846
+ "look": {
847
+ "react-native": "A sign-up screen exists but no \"Delete account\" action in settings.",
848
+ "swift": "Account sign-up exists with no deletion flow.",
849
+ "flutter": "Sign-up exists with no delete-account flow.",
850
+ "kotlin": "Sign-up exists with no delete-account flow (Play also requires a deletion link)."
851
+ },
852
+ "why": "Guideline 5.1.1(v) requires apps that support account creation to let people initiate account deletion in the app. Google Play requires an in-app and web deletion path too.",
853
+ "evidence": "brain:audit/ar-account-deletion",
854
+ "fix": {
855
+ "stack": "react-native",
856
+ "code": "<Button\n title=\"Delete account\"\n color=\"red\"\n onPress={() => Alert.alert('Delete account?', 'This removes your data.', [\n { text: 'Cancel', style: 'cancel' },\n { text: 'Delete', style: 'destructive', onPress: deleteAccount },\n ])}\n/>"
857
+ }
858
+ },
859
+ {
860
+ "id": "ar-purpose-strings",
861
+ "area": "apple-rule",
862
+ "severity": "high",
863
+ "title": "Missing or vague permission purpose strings",
864
+ "look": {
865
+ "react-native": "app.json ios.infoPlist NS*UsageDescription missing or generic (\"This app needs access\"); expo plugins without the permission text.",
866
+ "swift": "Info.plist NSCameraUsageDescription, NSPhotoLibraryUsageDescription, NSLocationWhenInUseUsageDescription, NSUserTrackingUsageDescription missing or generic.",
867
+ "flutter": "ios/Runner/Info.plist purpose strings missing or generic.",
868
+ "kotlin": "AndroidManifest permissions requested without in-app rationale (shouldShowRequestPermissionRationale).",
869
+ "expo": "app.json/app.config ios.infoPlist or plugin options (expo-camera cameraPermission) missing or generic."
870
+ },
871
+ "why": "Guideline 5.1.1 requires purpose strings that clearly say why the data is needed; vague ones are rejected. A missing key makes iOS terminate the app when the API is called.",
872
+ "evidence": "brain:audit/ar-purpose-strings",
873
+ "fix": {
874
+ "stack": "expo",
875
+ "code": "{\n \"expo\": {\n \"ios\": {\n \"infoPlist\": {\n \"NSCameraUsageDescription\": \"Scan your receipt to add the expense automatically.\"\n }\n }\n }\n}"
876
+ }
877
+ },
878
+ {
879
+ "id": "ar-login-wall",
880
+ "area": "apple-rule",
881
+ "severity": "medium",
882
+ "title": "Login required although the app has no significant account features",
883
+ "look": {
884
+ "react-native": "All routes behind an auth guard although data is local.",
885
+ "swift": "Root view requires sign-in although data is stored on device.",
886
+ "flutter": "GoRouter redirect to /login for everything.",
887
+ "kotlin": "NavHost starts at login for all users."
888
+ },
889
+ "why": "Guideline 5.1.1(v): if the app does not include significant account-based features, people must be able to use it without a login. Purchases also must not require an account unless the content is account-based.",
890
+ "evidence": "brain:onboarding/su-forced-account-before-value",
891
+ "fix": {
892
+ "stack": "flutter",
893
+ "code": "redirect: (context, state) {\n final needsAccount = state.matchedLocation.startsWith('/sync');\n if (needsAccount && auth.user == null) return '/login';\n return null;\n},"
894
+ }
895
+ },
896
+ {
897
+ "id": "ar-privacy-policy",
898
+ "area": "apple-rule",
899
+ "severity": "medium",
900
+ "title": "No privacy policy link inside the app",
901
+ "look": {
902
+ "react-native": "No privacy policy link in settings or the paywall.",
903
+ "swift": "No privacy policy link in settings.",
904
+ "flutter": "No privacy policy link in settings.",
905
+ "kotlin": "No privacy policy link in settings."
906
+ },
907
+ "why": "Guideline 5.1.1(i) requires a privacy policy link in the App Store Connect metadata and within the app in an easily accessible way.",
908
+ "evidence": "brain:audit/ar-privacy-policy",
909
+ "fix": {
910
+ "stack": "kotlin",
911
+ "code": "TextButton(onClick = { uriHandler.openUri(PRIVACY_URL) }) {\n Text(\"Privacy Policy\")\n}"
912
+ }
913
+ },
914
+ {
915
+ "id": "ar-att",
916
+ "area": "apple-rule",
917
+ "severity": "high",
918
+ "title": "Tracking without App Tracking Transparency, or access gated on allowing tracking",
919
+ "look": {
920
+ "react-native": "Facebook SDK, AppsFlyer, Adjust or ad SDKs reading IDFA with no requestTrackingPermissionsAsync; rewards offered for allowing tracking.",
921
+ "swift": "AdSupport/IDFA use with no ATTrackingManager.requestTrackingAuthorization; NSUserTrackingUsageDescription missing.",
922
+ "flutter": "app_tracking_transparency never called while ad/attribution SDKs run.",
923
+ "kotlin": "n/a (Android advertising ID rules differ); check iOS builds."
924
+ },
925
+ "why": "Guideline 5.1.2(i) requires ATT permission before tracking and forbids gating features or giving incentives for allowing it. Violations are rejected and can get attribution SDKs data dropped.",
926
+ "evidence": "brain:onboarding/perm-att-incentive",
927
+ "fix": {
928
+ "stack": "swift",
929
+ "code": "func requestTracking() async {\n guard ATTrackingManager.trackingAuthorizationStatus == .notDetermined else { return }\n let status = await ATTrackingManager.requestTrackingAuthorization()\n Analytics.setTracking(enabled: status == .authorized)\n}"
930
+ }
931
+ },
932
+ {
933
+ "id": "ar-review-readiness",
934
+ "area": "apple-rule",
935
+ "severity": "high",
936
+ "title": "App Review cannot reach or complete the purchase flow",
937
+ "look": {
938
+ "react-native": "Paywall behind a remote-config flag defaulting to off, product ids that differ from App Store Connect, or no demo path past login.",
939
+ "swift": "Same: feature flags defaulting off, test product ids, login with no demo account.",
940
+ "flutter": "Same: remote config defaults, wrong product ids, login with no demo path.",
941
+ "kotlin": "Same for Play review: license testers, product ids, login."
942
+ },
943
+ "why": "Guideline 2.1 requires a complete app with in-app purchases complete, visible and functional for the reviewer, and a demo account if login is required. A paywall the reviewer cannot load is a rejection and a lost release week.",
944
+ "evidence": "brain:audit/ar-review-readiness",
945
+ "fix": {
946
+ "stack": "react-native",
947
+ "code": "const paywallEnabled = remoteConfig.getValue('paywall_enabled').asBoolean() ?? true\nconst PRODUCT_IDS = ['app.pro.annual', 'app.pro.monthly'] as const"
948
+ }
949
+ },
950
+ {
951
+ "id": "ar-placeholder",
952
+ "area": "apple-rule",
953
+ "severity": "medium",
954
+ "title": "Placeholder, beta or \"coming soon\" content in the shipped UI",
955
+ "look": {
956
+ "react-native": "Strings like \"Lorem ipsum\", \"TODO\", \"Coming soon\", \"Beta\" or disabled buttons for unbuilt features.",
957
+ "swift": "Same in Swift/storyboards/xcstrings.",
958
+ "flutter": "Same in Dart/ARB files.",
959
+ "kotlin": "Same in strings.xml/Compose."
960
+ },
961
+ "why": "Guideline 2.1 rejects incomplete apps with placeholder content, and 2.2 rejects beta or trial builds on the App Store. Dead buttons near the paywall also cut trust.",
962
+ "evidence": "brain:audit/ar-placeholder",
963
+ "fix": {
964
+ "stack": "react-native",
965
+ "code": "const features = ALL_FEATURES.filter((f) => f.shipped)\n\n{features.map((f) => <FeatureRow key={f.id} {...f} />)}"
966
+ }
967
+ },
968
+ {
969
+ "id": "ar-sign-in-with-apple",
970
+ "area": "apple-rule",
971
+ "severity": "medium",
972
+ "title": "Third-party login without an equivalent privacy-focused option",
973
+ "look": {
974
+ "react-native": "Google/Facebook sign-in buttons with no expo-apple-authentication or @invertase/react-native-apple-authentication.",
975
+ "swift": "GIDSignIn/FBSDKLoginKit with no ASAuthorizationAppleIDProvider.",
976
+ "flutter": "google_sign_in/flutter_facebook_auth with no sign_in_with_apple.",
977
+ "kotlin": "n/a on Android; check the iOS build.",
978
+ "swiftui": "No SignInWithAppleButton beside third-party login buttons."
979
+ },
980
+ "why": "Guideline 4.8 requires apps that use a third-party login for the primary account to also offer a login that limits data to name and email and allows a private email, such as Sign in with Apple.",
981
+ "evidence": "brain:onboarding/su-siwa-missing-or-smaller",
982
+ "fix": {
983
+ "stack": "swiftui",
984
+ "code": "SignInWithAppleButton(.signIn) { request in\n request.requestedScopes = [.fullName, .email]\n} onCompletion: { result in\n auth.handleApple(result)\n}\n.frame(height: 44)"
985
+ }
986
+ },
987
+ {
988
+ "id": "ar-custom-review-prompt",
989
+ "area": "apple-rule",
990
+ "severity": "low",
991
+ "title": "Custom \"Rate us\" dialog instead of the system review prompt",
992
+ "look": {
993
+ "react-native": "A custom 5-star modal that opens the App Store review page, or that only sends happy users to the store.",
994
+ "swift": "A custom rating view instead of AppStore.requestReview(in:).",
995
+ "flutter": "A custom stars dialog instead of in_app_review.",
996
+ "kotlin": "A custom dialog instead of the Play In-App Review API."
997
+ },
998
+ "why": "Guideline 5.6.1 requires the provided API for in-app review prompts; custom prompts get rejected, and Play forbids incentivized or gated ratings.",
999
+ "evidence": "brain:onboarding/ppw-rating-prompt-in-onboarding",
1000
+ "fix": {
1001
+ "stack": "react-native",
1002
+ "code": "import * as StoreReview from 'expo-store-review'\n\nif (await StoreReview.hasAction()) await StoreReview.requestReview()"
1003
+ }
1004
+ }
1005
+ ]
1006
+ }