reis-mobile 0.9.0 → 0.10.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.
- package/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +37 -0
- package/README.md +64 -29
- package/THIRD_PARTY_NOTICES.md +41 -0
- package/agents/lead-mobile.md +14 -3
- package/agents/mobile-release-engineer.md +2 -0
- package/agents/mobile-staff-engineer.md +17 -3
- package/agents/mobile-ui-ux-designer.md +33 -0
- package/commands/debate.md +21 -14
- package/core/router/intent-detector.mjs +3 -2
- package/core/router/intents.mjs +59 -2
- package/package.json +1 -1
- package/skills/mobile-analytics/SKILL.md +55 -0
- package/skills/mobile-analytics/references/android.md +9 -0
- package/skills/mobile-analytics/references/flutter.md +10 -0
- package/skills/mobile-analytics/references/ios.md +9 -0
- package/skills/mobile-analytics/references/kotlin-multiplatform.md +8 -0
- package/skills/mobile-analytics/references/react-native.md +9 -0
- package/skills/mobile-android/SKILL.md +5 -1
- package/skills/mobile-auth/SKILL.md +55 -0
- package/skills/mobile-auth/references/android.md +10 -0
- package/skills/mobile-auth/references/flutter.md +9 -0
- package/skills/mobile-auth/references/ios.md +10 -0
- package/skills/mobile-auth/references/kotlin-multiplatform.md +9 -0
- package/skills/mobile-auth/references/react-native.md +9 -0
- package/skills/mobile-billing/SKILL.md +58 -0
- package/skills/mobile-billing/references/android.md +11 -0
- package/skills/mobile-billing/references/flutter.md +11 -0
- package/skills/mobile-billing/references/ios.md +11 -0
- package/skills/mobile-billing/references/kotlin-multiplatform.md +9 -0
- package/skills/mobile-billing/references/react-native.md +10 -0
- package/skills/mobile-ci/SKILL.md +49 -0
- package/skills/mobile-ci/references/android.md +8 -0
- package/skills/mobile-ci/references/fastlane/beta.md +75 -0
- package/skills/mobile-ci/references/fastlane/match.md +288 -0
- package/skills/mobile-ci/references/fastlane/release.md +113 -0
- package/skills/mobile-ci/references/fastlane/setup-fastlane.md +150 -0
- package/skills/mobile-ci/references/fastlane/snapshot.md +394 -0
- package/skills/mobile-ci/references/fastlane/xcode-cloud.md +110 -0
- package/skills/mobile-ci/references/flutter.md +8 -0
- package/skills/mobile-ci/references/ios.md +9 -0
- package/skills/mobile-ci/references/kotlin-multiplatform.md +8 -0
- package/skills/mobile-ci/references/react-native.md +8 -0
- package/skills/mobile-firebase/SKILL.md +3 -1
- package/skills/mobile-flutter/SKILL.md +5 -1
- package/skills/mobile-hardware/SKILL.md +58 -0
- package/skills/mobile-hardware/references/android.md +12 -0
- package/skills/mobile-hardware/references/flutter.md +10 -0
- package/skills/mobile-hardware/references/ios.md +11 -0
- package/skills/mobile-hardware/references/kotlin-multiplatform.md +9 -0
- package/skills/mobile-hardware/references/react-native.md +10 -0
- package/skills/mobile-ios/SKILL.md +5 -1
- package/skills/mobile-kmp/SKILL.md +5 -1
- package/skills/mobile-migration/SKILL.md +66 -0
- package/skills/mobile-migration/references/android.md +9 -0
- package/skills/mobile-migration/references/flutter.md +10 -0
- package/skills/mobile-migration/references/ios.md +10 -0
- package/skills/mobile-migration/references/kotlin-multiplatform.md +9 -0
- package/skills/mobile-migration/references/react-native.md +10 -0
- package/skills/mobile-networking/SKILL.md +50 -0
- package/skills/mobile-networking/references/android.md +10 -0
- package/skills/mobile-networking/references/flutter.md +9 -0
- package/skills/mobile-networking/references/ios.md +10 -0
- package/skills/mobile-networking/references/kotlin-multiplatform.md +9 -0
- package/skills/mobile-networking/references/react-native.md +11 -0
- package/skills/mobile-notifications/SKILL.md +51 -0
- package/skills/mobile-notifications/references/android.md +10 -0
- package/skills/mobile-notifications/references/flutter.md +10 -0
- package/skills/mobile-notifications/references/ios.md +11 -0
- package/skills/mobile-notifications/references/kotlin-multiplatform.md +9 -0
- package/skills/mobile-notifications/references/react-native.md +10 -0
- package/skills/mobile-observability/SKILL.md +1 -1
- package/skills/mobile-offline-sync/SKILL.md +2 -0
- package/skills/mobile-privacy/SKILL.md +54 -0
- package/skills/mobile-privacy/references/android.md +10 -0
- package/skills/mobile-privacy/references/flutter.md +9 -0
- package/skills/mobile-privacy/references/ios.md +10 -0
- package/skills/mobile-privacy/references/kotlin-multiplatform.md +9 -0
- package/skills/mobile-privacy/references/react-native.md +9 -0
- package/skills/mobile-release/SKILL.md +1 -0
- package/skills/mobile-release/references/billing.md +2 -0
- package/skills/mobile-release/references/ci-cd.md +2 -0
- package/skills/mobile-rn/SKILL.md +5 -1
- package/skills/mobile-security/SKILL.md +2 -0
- package/skills/mobile-ui-ux/SKILL.md +53 -0
- package/skills/mobile-ui-ux/references/android.md +11 -0
- package/skills/mobile-ui-ux/references/apple-design.md +32 -0
- package/skills/mobile-ui-ux/references/flutter.md +11 -0
- package/skills/mobile-ui-ux/references/ios.md +11 -0
- package/skills/mobile-ui-ux/references/kotlin-multiplatform.md +11 -0
- package/skills/mobile-ui-ux/references/react-native.md +11 -0
package/core/router/intents.mjs
CHANGED
|
@@ -11,7 +11,7 @@ export const INTENTS = {
|
|
|
11
11
|
security: [
|
|
12
12
|
'seguranca', 'security', 'vulnerab', 'owasp', 'secret', 'credencia', 'criptograf',
|
|
13
13
|
'encrypt', 'ssl pinning', 'certificate pinning', 'jailbreak', 'root detection',
|
|
14
|
-
'keychain', 'secure storage',
|
|
14
|
+
'keychain', 'secure storage',
|
|
15
15
|
],
|
|
16
16
|
performance: [
|
|
17
17
|
'performance', 'desempenho', 'lento', 'lentidao', 'slow', 'jank', 'fps', 'memoria',
|
|
@@ -51,8 +51,16 @@ export const INTENTS = {
|
|
|
51
51
|
'acessibilidade', 'accessibility', 'a11y', 'leitor de tela', 'screen reader',
|
|
52
52
|
'talkback', 'voiceover', 'contraste', 'semantics',
|
|
53
53
|
],
|
|
54
|
+
// Keep visual design separate from software architecture and UI test requests.
|
|
55
|
+
design: [
|
|
56
|
+
'ui/ux', 'ux/ui', 'ui design', 'ux design', 'design review', 'design de interface',
|
|
57
|
+
'design de tela', 'design system', 'visual design', 'interface design',
|
|
58
|
+
'wireframe', 'usabilidade', 'usability', 'hierarquia visual', 'visual hierarchy',
|
|
59
|
+
'tipografia', 'typography', 'apple hig', 'human interface guidelines',
|
|
60
|
+
'liquid glass', 'redesign', 'redesenhar',
|
|
61
|
+
],
|
|
54
62
|
review: [
|
|
55
|
-
'review', 'revis', 'code review', 'pull request', 'pr', 'analis', 'avali', 'audit',
|
|
63
|
+
'review', 'revis', 'code review', 'pull request', 'pr', 'prs', 'analis', 'avali', 'audit',
|
|
56
64
|
'code smell',
|
|
57
65
|
],
|
|
58
66
|
migration: ['migra', 'migrate', 'upgrade', 'null safety'],
|
|
@@ -67,10 +75,59 @@ export const INTENTS = {
|
|
|
67
75
|
'deploy', 'pipeline', 'ci/cd', 'github actions', 'fastlane', 'codemagic', 'bitrise',
|
|
68
76
|
'azure devops',
|
|
69
77
|
],
|
|
78
|
+
privacy: [
|
|
79
|
+
'privacy', 'privacidade', 'consent', 'consentimento', 'account deletion',
|
|
80
|
+
'delete account', 'exclusao de conta', 'excluir conta', 'data retention',
|
|
81
|
+
'retencao de dados', 'privacy manifest', 'data safety', 'analytics consent',
|
|
82
|
+
],
|
|
83
|
+
networking: [
|
|
84
|
+
'networking', 'api integration', 'integracao de api', 'integrar api',
|
|
85
|
+
'http client', 'cliente http', 'pagination', 'paginacao', 'resumable upload',
|
|
86
|
+
'upload retomavel', 'websocket', 'request cancellation', 'cancelar requisic',
|
|
87
|
+
],
|
|
88
|
+
auth: [
|
|
89
|
+
'authentication', 'autentica', 'passkey', 'sign-in', 'sign in', 'login',
|
|
90
|
+
'logout', 'oauth', 'oidc', 'pkce', 'session management', 'gestao de sessao',
|
|
91
|
+
'account linking', 'vincular conta', 'token refresh', 'renovacao de token',
|
|
92
|
+
],
|
|
93
|
+
notifications: [
|
|
94
|
+
'push notification', 'local notification', 'notification permission',
|
|
95
|
+
'notification channel', 'notification tap', 'notifica', 'fcm', 'apns',
|
|
96
|
+
],
|
|
97
|
+
// "assinatura", "subscription" and "entitlement" alone also mean code signing, a stream
|
|
98
|
+
// subscription and an iOS signing entitlement, so only specific phrases route here.
|
|
99
|
+
billing: [
|
|
100
|
+
'billing', 'cobranca', 'in-app purchase', 'in app purchase', 'compra no app',
|
|
101
|
+
'compras no app', 'compra dentro do app', 'compras dentro do app', 'compra in-app',
|
|
102
|
+
'compras in-app', 'subscription purchase', 'in-app subscription', 'auto-renewable',
|
|
103
|
+
'assinatura no app', 'assinaturas no app', 'assinatura recorrente', 'paywall', 'storekit',
|
|
104
|
+
'play billing', 'restore purchase', 'restaurar compra', 'revenuecat',
|
|
105
|
+
],
|
|
106
|
+
// Plain "analytics" stays with observability; these longer phrases claim their span first.
|
|
107
|
+
analytics: [
|
|
108
|
+
'product analytics', 'analytics de produto', 'tracking plan', 'plano de tracking',
|
|
109
|
+
'plano de rastreamento', 'event tracking', 'rastreamento de eventos', 'event taxonomy',
|
|
110
|
+
'taxonomia de eventos', 'analytics event', 'evento de analytics', 'eventos de analytics',
|
|
111
|
+
'funnel', 'funil', 'conversion event', 'evento de conversao', 'user properties',
|
|
112
|
+
'propriedades de usuario', 'mixpanel', 'posthog', 'amplitude analytics', 'amplitude sdk',
|
|
113
|
+
],
|
|
114
|
+
// "localizacao" alone also means translation, so location uses specific phrases; "ble" is a
|
|
115
|
+
// whole word (see WHOLE_WORDS). Biometrics belongs to auth and security.
|
|
116
|
+
hardware: [
|
|
117
|
+
'hardware', 'bluetooth', 'ble', 'nfc', 'camera', 'microphone', 'microfone', 'sensor',
|
|
118
|
+
'accelerometer', 'acelerometro', 'gyroscope', 'giroscopio', 'gps', 'geolocation',
|
|
119
|
+
'geolocaliza', 'geofenc', 'background location', 'localizacao em segundo plano',
|
|
120
|
+
'location updates', 'atualizacoes de localizacao', 'barcode', 'codigo de barras', 'qr code',
|
|
121
|
+
'codigo qr', 'haptic', 'vibration', 'vibracao', 'usb',
|
|
122
|
+
],
|
|
70
123
|
};
|
|
71
124
|
|
|
72
125
|
export const INTENT_IDS = Object.keys(INTENTS);
|
|
73
126
|
|
|
127
|
+
// Terms matched as whole words instead of stems: as stems, "pr" would also claim "premium",
|
|
128
|
+
// "product" and "preço", and "ble" would claim "blend".
|
|
129
|
+
export const WHOLE_WORDS = new Set(['pr', 'prs', 'ble']);
|
|
130
|
+
|
|
74
131
|
// A failing build or pipeline is a debugging task, not a build/deploy task.
|
|
75
132
|
export const DEBUG_DOMINATES = new Set(['build', 'deployment', 'dependency', 'migration']);
|
|
76
133
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reis-mobile",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.1",
|
|
4
4
|
"description": "AI agents and skills for Flutter, Android, iOS, React Native and Kotlin Multiplatform — a Claude Code and Codex plugin for reviews, debugging, tests, architecture, security and Firebase.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mobile-analytics
|
|
3
|
+
description: Designs and reviews product analytics across Flutter, Android, iOS, React Native and Kotlin Multiplatform. Use for tracking plans, event names and properties, funnels and conversion events, screen tracking, analytics identity across sign-in and sign-out, consent-gated collection and validating events before release. Crash, error and performance telemetry belong to mobile-observability.
|
|
4
|
+
intents: [analytics]
|
|
5
|
+
stacks: ["*"]
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Mobile Analytics
|
|
9
|
+
|
|
10
|
+
An analytics event is a contract with whoever reads the dashboard. Trace each event from the user action to the destination and to the question it answers. Reuse the [project brief](../../docs/agent-context.md), then inspect the SDK initialization, the existing event calls, the tracking plan if one exists and the owner of consent state before adding events.
|
|
11
|
+
|
|
12
|
+
## Pick the reference
|
|
13
|
+
|
|
14
|
+
| Project | Read |
|
|
15
|
+
|---|---|
|
|
16
|
+
| Flutter | [references/flutter.md](references/flutter.md) |
|
|
17
|
+
| Android | [references/android.md](references/android.md) |
|
|
18
|
+
| iOS | [references/ios.md](references/ios.md) |
|
|
19
|
+
| React Native / Expo | [references/react-native.md](references/react-native.md) |
|
|
20
|
+
| Kotlin Multiplatform | [references/kotlin-multiplatform.md](references/kotlin-multiplatform.md) |
|
|
21
|
+
|
|
22
|
+
Cross-platform apps also need the native references: SDKs often collect automatically before Dart or JavaScript runs. Confirm the SDK and its version from the lock file.
|
|
23
|
+
|
|
24
|
+
## Write the tracking plan first
|
|
25
|
+
|
|
26
|
+
For each event record the name, the exact trigger, the properties with their types and allowed values, the owner and the product question it answers. "Order completed" fires after the server confirms the order, not when the button is tapped. Follow the naming already in the plan or the SDK's conventions, and check the destination's documented limits for names, property counts and value lengths. An event nobody reads costs battery, data and privacy review; remove it from the plan.
|
|
27
|
+
|
|
28
|
+
## Emit through one boundary
|
|
29
|
+
|
|
30
|
+
- Send every event through one app-owned analytics interface with typed events. SDK calls scattered across screens cannot be gated by consent, tested or moved to another vendor.
|
|
31
|
+
- Fire each event once, on the confirmed outcome. Rebuilds, recomposition, re-renders, retries, back navigation and app resume must not duplicate it.
|
|
32
|
+
- Track screen views from the navigation owner, not from build or render code.
|
|
33
|
+
- Attach no direct personal data: no email, phone number, name or free text the user typed. Identify users with a stable internal id, never with an email.
|
|
34
|
+
|
|
35
|
+
## Identity and consent
|
|
36
|
+
|
|
37
|
+
- Before sign-in, events belong to the SDK's anonymous id. On sign-in, set the internal user id. On sign-out or an account switch, reset the analytics identity so the next user's events are not attributed to the previous one.
|
|
38
|
+
- Collection follows the consent state owned by [mobile-privacy](../mobile-privacy/SKILL.md). Start with collection disabled where the SDK supports it until consent is known, and stop sending on withdrawal.
|
|
39
|
+
- Whether a use counts as tracking under Apple's rules, and what the store data disclosures must declare, depends on the data and its recipients. Check the declarations against the actual collection.
|
|
40
|
+
|
|
41
|
+
## Delivery and trust
|
|
42
|
+
|
|
43
|
+
SDKs batch and upload events, so events can arrive late, offline events can be dropped by the SDK's limits and events in flight can be lost when the process dies. Do not use client analytics as the source of truth for revenue or business records: purchase revenue comes from the backend and store notifications through [mobile-billing](../mobile-billing/SKILL.md).
|
|
44
|
+
|
|
45
|
+
## Verify and deliver
|
|
46
|
+
|
|
47
|
+
Unit-test that a flow produces the expected typed events through a fake analytics implementation, including no events before consent, one event per confirmed outcome and an identity reset on sign-out. Then use the destination's debug or live event view with a debug build to confirm names and properties arrive as planned.
|
|
48
|
+
|
|
49
|
+
Return the tracking plan changes, `path:symbol` for each emission, test results and any dashboard or destination configuration you could not verify. Use [mobile-observability](../mobile-observability/SKILL.md) for crashes, errors and performance signals and [mobile-firebase](../mobile-firebase/SKILL.md) for Firebase Analytics setup.
|
|
50
|
+
|
|
51
|
+
## Official sources
|
|
52
|
+
|
|
53
|
+
- [Firebase Analytics events](https://firebase.google.com/docs/analytics/events)
|
|
54
|
+
- [Apple user privacy and data use](https://developer.apple.com/app-store/user-privacy-and-data-use/)
|
|
55
|
+
- [Google Play Data safety](https://support.google.com/googleplay/android-developer/answer/10787469)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Analytics on Android
|
|
2
|
+
|
|
3
|
+
- Read the SDK from the version catalog or Gradle files and inspect what it collects automatically at startup; a consent switch in the UI cannot stop an initializer that already ran. When collection must wait for consent, disable automatic collection in the manifest as the [data collection guide](https://firebase.google.com/docs/analytics/configure-data-collection?platform=android) describes for Firebase, and enable it after consent.
|
|
4
|
+
- In Compose, do not log from a composable body: recomposition repeats it. Log screen views from navigation callbacks such as `NavController.addOnDestinationChangedListener`, and one-time events from the ViewModel after the outcome is confirmed.
|
|
5
|
+
- Firebase consent, screen views and DebugView setup are in the [Firebase Analytics reference](../../mobile-firebase/references/android/analytics.md).
|
|
6
|
+
- Reset the analytics identity in the sign-out flow, before the next account's events start.
|
|
7
|
+
- Test the ViewModel or use case with a fake analytics interface, and confirm delivery in the destination's debug view with a debug build.
|
|
8
|
+
|
|
9
|
+
Official reference: [Firebase Analytics events](https://firebase.google.com/docs/analytics/events?platform=android).
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Analytics in Flutter
|
|
2
|
+
|
|
3
|
+
- Confirm the SDK in `pubspec.lock` and the native SDK it wraps. Native code can collect automatic events before `runApp`, so disable that natively when collection must wait for consent. For Firebase, use the [Firebase Analytics reference](../../mobile-firebase/references/flutter/analytics.md) and the native switches in [Android](android.md) and [iOS](ios.md).
|
|
4
|
+
- Keep one Dart analytics interface with typed events, injected where the state owners can reach it. Do not call the SDK from `build()`: rebuilds repeat it.
|
|
5
|
+
- Track screen views with a navigator observer on the app's router (`FirebaseAnalyticsObserver` for Firebase) or from the router's route-change callback.
|
|
6
|
+
- Fire conversion events from the state owner after the repository confirms the outcome, not from the button callback.
|
|
7
|
+
- On sign-out, reset the SDK identity in the same flow that clears account data.
|
|
8
|
+
- Test with a fake analytics implementation in unit and widget tests, and confirm delivery on device builds.
|
|
9
|
+
|
|
10
|
+
Official reference: [FirebaseAnalyticsObserver](https://pub.dev/documentation/firebase_analytics/latest/observer/FirebaseAnalyticsObserver-class.html).
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Analytics on iOS
|
|
2
|
+
|
|
3
|
+
- Inventory the SDKs linked into the app and its extensions, what they collect at launch and what their privacy manifests declare. When Firebase collection must wait for consent, set `FIREBASE_ANALYTICS_COLLECTION_ENABLED` to `NO` in `Info.plist` and call `Analytics.setAnalyticsCollectionEnabled(true)` after consent.
|
|
4
|
+
- In SwiftUI, `.onAppear` runs again on tab switches and back navigation. Decide what a screen view means and log it from the navigation owner or with the SDK's screen modifier, not from `body`.
|
|
5
|
+
- Keep App Tracking Transparency separate from analytics consent: request ATT only when the data use is tracking, and never infer one from the other.
|
|
6
|
+
- Firebase consent, screen views and DebugView are in the [Firebase Analytics reference](../../mobile-firebase/references/ios/analytics.md).
|
|
7
|
+
- Reset the analytics identity during sign-out. Test event emission with a fake analytics protocol, and confirm delivery with the destination's debug view.
|
|
8
|
+
|
|
9
|
+
Official references: [configure data collection](https://firebase.google.com/docs/analytics/configure-data-collection?platform=ios), [user privacy and data use](https://developer.apple.com/app-store/user-privacy-and-data-use/).
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Analytics in Kotlin Multiplatform
|
|
2
|
+
|
|
3
|
+
- Define the typed events and the analytics interface in `commonMain`, and implement it per host with the native SDK unless the project already uses a multiplatform SDK.
|
|
4
|
+
- Keep consent and identity transitions in shared code when the project shares them, but leave automatic collection settings and SDK startup in each host: a `commonMain` flag does not stop a collector the host initialized first.
|
|
5
|
+
- Emit events from shared state owners after the outcome is confirmed, and map them to each SDK's names in one place.
|
|
6
|
+
- Test event emission in `commonTest` with a fake implementation. Verify each host's SDK delivery separately with [Android](android.md) and [iOS](ios.md).
|
|
7
|
+
|
|
8
|
+
Official reference: [platform-specific declarations](https://kotlinlang.org/docs/multiplatform/multiplatform-expect-actual.html).
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Analytics in React Native and Expo
|
|
2
|
+
|
|
3
|
+
- Confirm the SDK in `package.json` and the native SDK it wraps. Native code can collect before the JavaScript bundle runs: configure collection defaults natively, through a config plugin or the native files, instead of in a `useEffect`.
|
|
4
|
+
- Track screen views from the navigation container: with React Navigation, compare routes in `onStateChange` through a navigation ref; with Expo Router, react to `usePathname` changes.
|
|
5
|
+
- Fire conversion events after the mutation resolves, not on press. React Strict Mode runs effects twice in development, so emit from the handler of the confirmed outcome rather than from a mount effect.
|
|
6
|
+
- Firebase screen views, consent flags and DebugView are in the [Firebase Analytics reference](../../mobile-firebase/references/react-native/analytics.md).
|
|
7
|
+
- Reset the analytics identity in the sign-out flow. Test the boundary in Jest with the SDK mocked, and confirm delivery on native builds.
|
|
8
|
+
|
|
9
|
+
Official references: [React Navigation screen tracking](https://reactnavigation.org/docs/screen-tracking/), [Expo Router screen tracking](https://docs.expo.dev/router/reference/screen-tracking/). Apply the [Android](android.md) and [iOS](ios.md) references to native collection settings.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: mobile-android
|
|
3
3
|
description: Builds native Android apps with the Android team's guides — Jetpack Compose UI, adaptive layouts, edge-to-edge, Compose styles, migrating XML views to Compose, Navigation 3 and predictive back; Android Gradle Plugin 9 upgrades, R8 keep rule analysis, profiling with Android Studio and Perfetto, and the Android CLI; Google Play policy compliance, Play Billing upgrades and the Engage SDK; Credential Manager restore and verified email; CameraX and Media3 Cast; App Functions and the ML Kit GenAI Prompt API; Wear OS, Android TV and display glasses. Use when writing, upgrading or auditing native Android (Kotlin) code for any of these topics, even if the user does not name the library.
|
|
4
|
-
intents: [performance, release, migration, build, dependency]
|
|
4
|
+
intents: [design, performance, release, migration, build, dependency]
|
|
5
5
|
stacks: [android]
|
|
6
6
|
---
|
|
7
7
|
|
|
@@ -27,3 +27,7 @@ Each topic file lists its guides; open only the ones the task needs.
|
|
|
27
27
|
|
|
28
28
|
- Check the AGP, Kotlin, Compose BOM and `compileSdk`/`targetSdk` versions in the build files and version catalog; several guides depend on minimum versions.
|
|
29
29
|
- Several guides prescribe running specific tools or scripts and following steps strictly; run what writes files only with the user's agreement.
|
|
30
|
+
|
|
31
|
+
## Interface design
|
|
32
|
+
|
|
33
|
+
For UI/UX reviews, wireframes, design systems and screen redesigns, use [mobile-ui-ux](../mobile-ui-ux/SKILL.md) and its reference for this stack. For Apple targets, also consult its [Apple design workflow](../mobile-ui-ux/references/apple-design.md); validate platform claims against current official guidance and the installed toolkit.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mobile-auth
|
|
3
|
+
description: Implements and reviews mobile identity and session flows across Flutter, Android, iOS, React Native and Kotlin Multiplatform. Use for sign-in, passkeys, account recovery, provider linking, reauthentication, logout and concurrent refresh. Security audits belong to mobile-security; account deletion belongs to mobile-privacy.
|
|
4
|
+
intents: [auth]
|
|
5
|
+
stacks: ["*"]
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Mobile Authentication
|
|
9
|
+
|
|
10
|
+
Use the [project brief](../../docs/agent-context.md) to find the provider SDK/configuration, session owner, credential store, redirect handlers and account-scoped repositories. Preserve the chosen provider and the requested audit/implementation scope. Read installed versions and the provider's actual backend contract before selecting APIs.
|
|
11
|
+
|
|
12
|
+
## Pick the reference
|
|
13
|
+
|
|
14
|
+
| Project | Read |
|
|
15
|
+
|---|---|
|
|
16
|
+
| Flutter | [references/flutter.md](references/flutter.md) |
|
|
17
|
+
| Android | [references/android.md](references/android.md) |
|
|
18
|
+
| iOS | [references/ios.md](references/ios.md) |
|
|
19
|
+
| React Native / Expo | [references/react-native.md](references/react-native.md) |
|
|
20
|
+
| Kotlin Multiplatform | [references/kotlin-multiplatform.md](references/kotlin-multiplatform.md) |
|
|
21
|
+
|
|
22
|
+
## Define identity and session transitions
|
|
23
|
+
|
|
24
|
+
- Separate provider identity, backend account, session credentials and local unlock. Biometric approval alone is not server authentication.
|
|
25
|
+
- Model restoring, signed out, authenticating, signed in, reauthentication required and signing out as needed by the real flow. Temporary offline restoration is distinct from proven invalid credentials.
|
|
26
|
+
- Give each attempt a correlation identifier and cancellation owner. A cancelled sign-in or reauthentication preserves any existing valid session; it cannot silently replace it with a partially authenticated account.
|
|
27
|
+
- Complete account switching by invalidating old jobs, caches and notification bindings before exposing the new account's data. Fence late callbacks with account/session generation.
|
|
28
|
+
|
|
29
|
+
## Choose the provider-supported ceremony
|
|
30
|
+
|
|
31
|
+
- For OAuth/OIDC native login, use a maintained provider/library implementation of Authorization Code with PKCE through the system authentication browser. Keep client secrets off the app; verify redirect association and response binding using the SDK's documented protections.
|
|
32
|
+
- For passkeys, the backend issues challenges and verifies registration/authentication responses, relying-party identity and replay protections. Native credential APIs alone do not prove identity to your backend. Define recovery for unavailable credentials without weakening authentication.
|
|
33
|
+
- Link providers only after proving control according to the provider contract; matching email strings is not sufficient authority to merge accounts. Define collisions, cancellation and recovery before altering account ownership.
|
|
34
|
+
- Treat sensitive actions as backend-authorized operations with the required fresh authentication. Do not bypass reauthentication by changing a UI flag.
|
|
35
|
+
|
|
36
|
+
## Refresh, logout and recovery
|
|
37
|
+
|
|
38
|
+
- Use the provider SDK's session management if it already owns refresh. Otherwise coalesce refresh work per session; every waiter receives success, cancellation or failure, and retries have a bound.
|
|
39
|
+
- Before saving a refresh result, check that the session is still current. Logout/account switch must make an old result inert, including its queued request replays.
|
|
40
|
+
- Apply the provider's supported refresh-token protection. OAuth security guidance supports rotation or sender-constrained refresh tokens for public clients; do not invent a rotation endpoint or override SDK behavior.
|
|
41
|
+
- On logout, invalidate local access and clear scoped state. Track remote revocation separately when supported; if offline, report that it was not confirmed and use the provider's documented recovery strategy. Browser SSO logout and app logout are different operations.
|
|
42
|
+
- Recovery, MFA and linking error messages follow the actual identity provider and product requirements. Avoid exposing whether another account exists through custom recovery behavior.
|
|
43
|
+
|
|
44
|
+
## Verify and deliver
|
|
45
|
+
|
|
46
|
+
Test cancelled login, malformed/replayed callback, process recreation during login, concurrent refresh, offline restoration, logout during refresh, account switching, unavailable passkey, linking collision and cancelled reauthentication. Exercise provider integration in its test environment; keep tokens and personal data out of fixtures/logs.
|
|
47
|
+
|
|
48
|
+
Return a transition table tied to real symbols, provider/backend boundaries, storage and redirect changes, test results and remaining configuration evidence. Use [mobile-security](../mobile-security/SKILL.md) for threat review and secure storage, [mobile-firebase](../mobile-firebase/SKILL.md) for Firebase Auth APIs, and [mobile-privacy](../mobile-privacy/SKILL.md) for deletion.
|
|
49
|
+
|
|
50
|
+
## Official sources
|
|
51
|
+
|
|
52
|
+
- [OAuth for native apps, RFC 8252](https://www.rfc-editor.org/rfc/rfc8252.html)
|
|
53
|
+
- [OAuth security best current practice, RFC 9700](https://www.rfc-editor.org/rfc/rfc9700.html)
|
|
54
|
+
- [Android Credential Manager](https://developer.android.com/identity/credential-manager)
|
|
55
|
+
- [Apple AuthenticationServices](https://developer.apple.com/documentation/authenticationservices)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Authentication on Android
|
|
2
|
+
|
|
3
|
+
- Inspect the identity provider and resolved Credential Manager dependencies before choosing a sign-in API. Verify credential type and provider support on the app's OS/device range.
|
|
4
|
+
- Passkey registration/authentication exchanges server-generated request data and sends the response back for server verification. Validate the relying-party/domain association; a credential selector is not backend authorization.
|
|
5
|
+
- Give UI-bound credential/browser operations a valid host lifetime. Preserve attempt state across recreation as the SDK prescribes and distinguish user cancellation from invalid credentials.
|
|
6
|
+
- Coordinate logout with SDK credential/session state and the backend. Clearing a local credential preference does not revoke a remote session.
|
|
7
|
+
- Check [identity guides](../../mobile-android/references/identity.md) when restoring credentials or retrieving verified email; these features are separate from account merging.
|
|
8
|
+
- Test cancellation, no credential, provider unavailability, process recreation and account switching, including cached data isolation.
|
|
9
|
+
|
|
10
|
+
Official reference: [Credential Manager](https://developer.android.com/identity/credential-manager).
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Authentication in Flutter
|
|
2
|
+
|
|
3
|
+
- Inspect the installed provider plugin and the app's session state owner. Use its auth-state stream once at the appropriate lifetime; avoid separate login state in each screen.
|
|
4
|
+
- Verify native callback configuration on Android and iOS alongside Dart routing. A successful provider callback is not evidence the backend session was established.
|
|
5
|
+
- Restore secure credentials before making account-scoped requests; do not show another account's cached content while restoration is unresolved.
|
|
6
|
+
- Passkey support depends on the actual plugin and host versions. Trace its registration/assertion response to backend verification; do not replace this with a local biometric boolean.
|
|
7
|
+
- Cancel/dispose listeners and invalidate in-flight refresh/login results on logout. Test the session state owner separately from widget navigation, then test the native callback in a device build.
|
|
8
|
+
|
|
9
|
+
Reuse [Firebase Auth guidance](../../mobile-firebase/references/flutter/auth.md) when installed and [secure token storage](../../mobile-security/references/flutter/secure-token-store.md). Official reference: [Flutter app links](https://docs.flutter.dev/cookbook/navigation/set-up-app-links).
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Authentication on iOS
|
|
2
|
+
|
|
3
|
+
- Use the provider-supported AuthenticationServices flow. For browser login, verify `ASWebAuthenticationSession` ownership, presentation context and callback configuration for the installed SDK/deployment target.
|
|
4
|
+
- For passkeys, configure the associated domain/relying party and verify responses on the server. Model cancellation, missing credentials and recovery explicitly.
|
|
5
|
+
- Treat Sign in with Apple identifiers and credentials through the provider contract. Do not depend on receiving profile fields on every sign-in, or equate a relay email with authority to merge accounts.
|
|
6
|
+
- Inspect Keychain accessibility and access groups against foreground/background needs. Keychain presence alone does not prove the server session is valid; define behavior across reinstall/account change.
|
|
7
|
+
- Guard shared refresh state across suspension points; invalidate late completions when the account changes.
|
|
8
|
+
- Test cancellation, return from browser, restored session, unavailable credentials and reauthentication with a configured test account.
|
|
9
|
+
|
|
10
|
+
Official references: [AuthenticationServices](https://developer.apple.com/documentation/authenticationservices), [ASWebAuthenticationSession](https://developer.apple.com/documentation/authenticationservices/aswebauthenticationsession).
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Authentication in Kotlin Multiplatform
|
|
2
|
+
|
|
3
|
+
- Share session models and backend exchanges where appropriate; host apps own browser presentation, credential prompts, secure storage and callback registration.
|
|
4
|
+
- Define typed results for success, cancellation, reauthentication and failure at the host boundary. A shared caller must not infer success because a native sheet closed.
|
|
5
|
+
- Use one session coordinator across shared callers. An actor/mutex boundary still needs session-generation checks after suspended backend operations.
|
|
6
|
+
- Never put a client secret or native UI dependency in `commonMain`. Passkeys still require backend challenges and verification; expose platform ceremonies through interfaces/target implementations.
|
|
7
|
+
- Test shared transition/race logic in `commonTest`; verify Android credential and iOS browser/passkey flows separately using [Android](android.md) and [iOS](ios.md).
|
|
8
|
+
|
|
9
|
+
Official reference: [Kotlin platform-specific declarations](https://kotlinlang.org/docs/multiplatform/multiplatform-expect-actual.html).
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Authentication in React Native and Expo
|
|
2
|
+
|
|
3
|
+
- Reuse the existing provider/auth library and secure native storage. Check callback schemes, app links and build configuration in both hosts, including Expo config plugins where used.
|
|
4
|
+
- In Expo, check the installed AuthSession/provider integration and test in a development build with the actual redirect. Do not assume Expo Go reproduces production schemes or native passkey support.
|
|
5
|
+
- Let the session owner coordinate refresh; a component remount must not start a second independent renewal. Abort or invalidate the old account's requests before clearing query caches and exposing another account.
|
|
6
|
+
- Native passkey APIs need a supported bridge and a server ceremony. JS token parsing or a biometric result cannot substitute for server verification.
|
|
7
|
+
- Test cancellation and linking conflicts in state logic, then callback routing and secure storage in a native build. Check startup before the navigation container becomes ready.
|
|
8
|
+
|
|
9
|
+
Official references: [Expo authentication](https://docs.expo.dev/guides/authentication/), [React Native security](https://reactnative.dev/docs/security). Reuse [Firebase Auth](../../mobile-firebase/references/react-native/auth.md) when that provider is installed.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mobile-billing
|
|
3
|
+
description: Implements and reviews in-app purchases and subscriptions across Flutter, Android, iOS, React Native and Kotlin Multiplatform. Use for product catalogs, purchase and restore flows, pending or interrupted purchases, server-side verification, acknowledgement, account binding, plan changes and store sandbox tests. Store submission belongs to mobile-release; account deletion to mobile-privacy.
|
|
4
|
+
intents: [billing]
|
|
5
|
+
stacks: ["*"]
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Mobile Billing
|
|
9
|
+
|
|
10
|
+
Trace each purchase from the product query to the entitlement your backend records. Reuse the [project brief](../../docs/agent-context.md), then inspect the billing client setup, the purchase listener, the backend verification endpoint and every screen that reads entitlement before changing a flow. The store-side lifecycle (subscription states, server notifications, acknowledgement deadlines, sandbox tools) is in the [billing lifecycle reference](../mobile-release/references/billing.md); this skill applies it to the app's code.
|
|
11
|
+
|
|
12
|
+
## Pick the reference
|
|
13
|
+
|
|
14
|
+
| Project | Read |
|
|
15
|
+
|---|---|
|
|
16
|
+
| Flutter | [references/flutter.md](references/flutter.md) |
|
|
17
|
+
| Android | [references/android.md](references/android.md) |
|
|
18
|
+
| iOS | [references/ios.md](references/ios.md) |
|
|
19
|
+
| React Native / Expo | [references/react-native.md](references/react-native.md) |
|
|
20
|
+
| Kotlin Multiplatform | [references/kotlin-multiplatform.md](references/kotlin-multiplatform.md) |
|
|
21
|
+
|
|
22
|
+
Flutter and React Native apps also need the Android and iOS references for store configuration and native behavior. Confirm the billing library version from the lock file; client APIs change across major versions.
|
|
23
|
+
|
|
24
|
+
## Build the purchase inventory
|
|
25
|
+
|
|
26
|
+
Record for each product: store product id, type (consumable, non-consumable, auto-renewable or non-renewing subscription), base plans and offers or subscription group, the call that starts the purchase, the listener that receives results, the backend endpoint that verifies, the code that reads entitlement and the acknowledge, consume or finish call. Mark store console and backend evidence you cannot read as unknown.
|
|
27
|
+
|
|
28
|
+
## The purchase is a state machine
|
|
29
|
+
|
|
30
|
+
- Register the purchase listener at startup, before any purchase UI, for the life of the process. Results arrive outside the paywall: renewals, deferred payments, Ask to Buy approvals, purchases from another device and purchases interrupted by process death.
|
|
31
|
+
- Model idle, purchasing, pending, verifying, granted, failed and cancelled. A user cancellation is a normal outcome: no error dialog and no retry.
|
|
32
|
+
- A pending purchase grants nothing. Show it as pending and grant only after the store reports the payment completed.
|
|
33
|
+
- Send the purchase token or signed transaction to the backend with the app account id. The backend verifies it with the store and records the entitlement idempotently, keyed by the store's purchase identifier (`purchaseToken` on Google Play, `transactionId` and `originalTransactionId` on the App Store), so a purchase delivered again by the listener, a restore or the next launch grants once.
|
|
34
|
+
- Acknowledge, consume or finish only after the backend confirms the record. On the next launch, query unfinished or unacknowledged purchases and resume verification; this is the recovery path for a crash between payment and record.
|
|
35
|
+
- Bind the purchase to the account that started it with the store's account field (`obfuscatedAccountId` on Google Play, `appAccountToken` on the App Store). A result that arrives after sign-out or an account switch is reconciled by the backend, never attached to whoever is signed in now.
|
|
36
|
+
|
|
37
|
+
## Entitlement and catalog
|
|
38
|
+
|
|
39
|
+
- Screens read entitlement from the backend. Cache the last known state for offline use with its timestamp, and decide explicitly what an expired cache allows.
|
|
40
|
+
- Display prices, currencies and offers only from the store's product details. Handle products missing from the current storefront.
|
|
41
|
+
- Upgrades, downgrades and plan changes follow each store's rules (replacement modes on Google Play, subscription group levels on the App Store). The backend links the replaced purchase to the new one.
|
|
42
|
+
- Provide restore: a visible restore action on iOS and a purchase query on launch and resume on Android. Refunds and revocations arrive through server notifications; the app shows the backend state and does not revoke on its own.
|
|
43
|
+
|
|
44
|
+
## Failure scenarios to test
|
|
45
|
+
|
|
46
|
+
Purchase interrupted by process death; verification failing on a network error and retried with the same token; the same purchase delivered twice; a pending purchase completed days later while the app is closed; user cancellation; a product id not found; an account switch during a purchase; a refund notification; access kept during a grace period or billing retry; restore on a fresh install.
|
|
47
|
+
|
|
48
|
+
## Verify and deliver
|
|
49
|
+
|
|
50
|
+
Use each store's sandbox: Google Play license testers on a testing track, StoreKit configuration files in Xcode and Sandbox accounts. Test the backend by replaying server notification payloads. Unit-test the purchase state machine against a fake billing client.
|
|
51
|
+
|
|
52
|
+
Return the purchase inventory with `path:symbol` evidence, the implemented transitions, test results and any unverified store console or backend configuration. Whether digital goods must use store billing depends on the market and changes often: check the current store policy instead of designing from memory. Use [mobile-release](../mobile-release/SKILL.md) for submission, [mobile-privacy](../mobile-privacy/SKILL.md) for account deletion versus cancellation, [mobile-security](../mobile-security/SKILL.md) for tampered clients and [mobile-analytics](../mobile-analytics/SKILL.md) for conversion events.
|
|
53
|
+
|
|
54
|
+
## Official sources
|
|
55
|
+
|
|
56
|
+
- [Google Play Billing integration](https://developer.android.com/google/play/billing/integrate)
|
|
57
|
+
- [StoreKit in-app purchase](https://developer.apple.com/documentation/storekit/in-app-purchase)
|
|
58
|
+
- [App Store Server Notifications](https://developer.apple.com/documentation/appstoreservernotifications)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Billing on Android
|
|
2
|
+
|
|
3
|
+
- Read the Play Billing Library version from the version catalog or Gradle files. Version upgrades and their removed APIs are in the [Play guides](../../mobile-android/references/play.md).
|
|
4
|
+
- Build one `BillingClient` with a `PurchasesUpdatedListener` and pending purchases enabled through `PendingPurchasesParams`. Play Billing Library 8 adds `enableAutoServiceReconnection()`; with it enabled, do not call `startConnection()` again from `onBillingServiceDisconnected`. Without it, reconnect before the next call.
|
|
5
|
+
- Query products with `queryProductDetailsAsync`. A subscription purchase needs the `offerToken` of the chosen offer in `BillingFlowParams`; set `setObfuscatedAccountId` with the app account id.
|
|
6
|
+
- Grant only when `getPurchaseState()` is `PURCHASED` and the backend has verified the `purchaseToken`. `PENDING` purchases complete later and arrive through the listener or the next query.
|
|
7
|
+
- After the backend records the purchase, call `acknowledgePurchase` for non-consumables and subscriptions or `consumeAsync` for consumables. Purchases not acknowledged within three days are refunded.
|
|
8
|
+
- Call `queryPurchasesAsync` on startup and on resume to recover purchases completed while the app was closed or killed.
|
|
9
|
+
- Test with license testers and a build uploaded to a testing track with the release package name and signing key.
|
|
10
|
+
|
|
11
|
+
Official references: [integrate the library](https://developer.android.com/google/play/billing/integrate), [test billing](https://developer.android.com/google/play/billing/test).
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Billing in Flutter
|
|
2
|
+
|
|
3
|
+
- Confirm the plugin in `pubspec.lock`: `in_app_purchase` with its Android and StoreKit implementations, or a vendor SDK. Read that version's documentation; the APIs below are from `in_app_purchase`.
|
|
4
|
+
- Listen to `InAppPurchase.instance.purchaseStream` from an app-level owner created at startup, not from the paywall widget. Cancel that `StreamSubscription` only when the owner is disposed.
|
|
5
|
+
- Check `isAvailable()` before `queryProductDetails()`, and handle the ids returned in `notFoundIDs`.
|
|
6
|
+
- Handle every `PurchaseStatus`: `pending`, `purchased`, `restored`, `error` and `canceled`. Send `verificationData.serverVerificationData` to the backend for purchased and restored items, then call `completePurchase` when `pendingCompletePurchase` is true.
|
|
7
|
+
- For consumables, pass `autoConsume: false` to `buyConsumable`: the default consumes the product right after a successful purchase, without waiting for your backend. On Android, consume after the backend records the purchase through `InAppPurchaseAndroidPlatformAddition.consumePurchase`.
|
|
8
|
+
- Pass the account identifier through `PurchaseParam.applicationUserName`, and confirm how the installed platform implementation forwards it to each store.
|
|
9
|
+
- Put the plugin behind an app interface so unit and widget tests can drive every purchase status with a fake stream. Store behavior needs device builds against the sandboxes in [Android](android.md) and [iOS](ios.md).
|
|
10
|
+
|
|
11
|
+
Official reference: [in_app_purchase](https://pub.dev/packages/in_app_purchase).
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Billing on iOS
|
|
2
|
+
|
|
3
|
+
- Use StoreKit 2 unless the deployment target or an existing integration requires the original API. The basic purchase call is in the [StoreKit section](../../mobile-ios/references/platform-features.md).
|
|
4
|
+
- Start a long-lived task over `Transaction.updates` at launch, before any purchase UI. It delivers renewals, Ask to Buy approvals, refunds and purchases made on other devices.
|
|
5
|
+
- Purchase with `product.purchase(options:)` including `.appAccountToken(_:)` set to the account's UUID. Handle `.success`, `.pending` and `.userCancelled`; grant only a `.verified` transaction.
|
|
6
|
+
- Send the signed transaction (`jwsRepresentation`) to the backend and call `transaction.finish()` after the backend records it. Iterate `Transaction.unfinished` at launch to resume interrupted verifications.
|
|
7
|
+
- Read `Transaction.currentEntitlements` and the subscription `status` to display state, but let the backend decide access. Distinguish `inGracePeriod` and `inBillingRetryPeriod` from `expired` and `revoked`.
|
|
8
|
+
- Offer restore through `AppStore.sync()` behind an explicit user action; it can prompt for the Apple Account.
|
|
9
|
+
- Test with a StoreKit configuration file in the scheme, then Sandbox and TestFlight.
|
|
10
|
+
|
|
11
|
+
Official references: [In-App Purchase](https://developer.apple.com/documentation/storekit/in-app-purchase), [StoreKit testing in Xcode](https://developer.apple.com/documentation/xcode/setting-up-storekit-testing-in-xcode).
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Billing in Kotlin Multiplatform
|
|
2
|
+
|
|
3
|
+
- Keep product ids, the purchase state machine, the entitlement model and backend verification calls in `commonMain` when the project shares that logic. Keep `BillingClient` in Android code and StoreKit in the iOS app.
|
|
4
|
+
- StoreKit 2 is a Swift-only API, so Kotlin/Native cannot call it through Objective-C interop. Implement the iOS store client in Swift and inject it into shared code through an interface the shared module exports.
|
|
5
|
+
- Define one shared result type for purchased, pending, cancelled and failed, and map each host's results into it without losing the store purchase identifier.
|
|
6
|
+
- Start each host's listener at app launch and forward results to the shared owner. Each host keeps its own acknowledge or finish call, made after the backend confirms the record.
|
|
7
|
+
- Test the shared state machine in `commonTest` with a fake store client. Test each host against its store sandbox separately; an Android pass does not prove StoreKit behavior.
|
|
8
|
+
|
|
9
|
+
Official references: [platform-specific declarations](https://kotlinlang.org/docs/multiplatform/multiplatform-expect-actual.html), [Swift and Objective-C interop](https://kotlinlang.org/docs/native-objc-interop.html).
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Billing in React Native and Expo
|
|
2
|
+
|
|
3
|
+
- Confirm the library in `package.json` and the lockfile (`react-native-iap`, a vendor SDK such as RevenueCat's, or native modules). Check its support for the installed React Native version and the New Architecture.
|
|
4
|
+
- In-app purchases need native code: Expo Go cannot run them, so use a development build. Add store capabilities and permissions through the library's config plugin or the native project files.
|
|
5
|
+
- Open the store connection and register purchase listeners in an app-root owner, not in the paywall screen, and remove them only when that owner unmounts. Keep listener callbacks idempotent: React Strict Mode runs effects twice in development.
|
|
6
|
+
- Send the purchase token or signed transaction to the backend. Call the library's finish or acknowledge function only after the backend records it, marking consumables as such.
|
|
7
|
+
- Ignore late results for an account generation that is no longer active, and let the backend reconcile them.
|
|
8
|
+
- Test the purchase state machine in Jest with the native module mocked. Store behavior needs native builds against the [Android](android.md) and [iOS](ios.md) sandboxes.
|
|
9
|
+
|
|
10
|
+
Official reference: [Expo development builds](https://docs.expo.dev/develop/development-builds/introduction/). Store rules for digital goods are in the [platform guide](../../mobile-rn/references/platform-features.md).
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mobile-ci
|
|
3
|
+
description: Sets up and reviews mobile CI/CD and fastlane automation across Flutter, Android, iOS, React Native and Kotlin Multiplatform. Use for Fastfile lanes, Match signing, TestFlight beta uploads, App Store submission, Snapshot screenshots, Xcode Cloud or build and deployment pipelines.
|
|
4
|
+
intents: [deployment]
|
|
5
|
+
stacks: ["*"]
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Mobile CI
|
|
9
|
+
|
|
10
|
+
Connect the app's existing build, test, signing and distribution steps into a reproducible pipeline. Use [mobile-release](../mobile-release/SKILL.md) for release readiness and rollout decisions.
|
|
11
|
+
|
|
12
|
+
## Choose the references
|
|
13
|
+
|
|
14
|
+
Load the app's stack reference, then only the fastlane guide needed for the task. Cross-platform apps also need the reference for each native target being shipped.
|
|
15
|
+
|
|
16
|
+
| Need | Read |
|
|
17
|
+
|---|---|
|
|
18
|
+
| Flutter | [references/flutter.md](references/flutter.md) |
|
|
19
|
+
| Android, including a cross-platform Android host | [references/android.md](references/android.md) |
|
|
20
|
+
| iOS, including a cross-platform iOS host | [references/ios.md](references/ios.md) |
|
|
21
|
+
| React Native or Expo | [references/react-native.md](references/react-native.md) |
|
|
22
|
+
| Kotlin Multiplatform | [references/kotlin-multiplatform.md](references/kotlin-multiplatform.md) |
|
|
23
|
+
| Pipeline jobs, caches, credentials and artifact retention | [Shared CI/CD guide](../mobile-release/references/ci-cd.md) |
|
|
24
|
+
| Initialize fastlane and define iOS lanes | [Setup](references/fastlane/setup-fastlane.md) |
|
|
25
|
+
| iOS certificates and provisioning profiles | [Match](references/fastlane/match.md) |
|
|
26
|
+
| TestFlight internal and external testing | [Beta](references/fastlane/beta.md) |
|
|
27
|
+
| App Store submission and metadata | [Release](references/fastlane/release.md) |
|
|
28
|
+
| Capture, frame and upload App Store screenshots | [Snapshot](references/fastlane/snapshot.md) |
|
|
29
|
+
| Xcode Cloud workflow integration | [Xcode Cloud](references/fastlane/xcode-cloud.md) |
|
|
30
|
+
|
|
31
|
+
## Workflow
|
|
32
|
+
|
|
33
|
+
1. Inspect existing workflows, Fastfile, Appfile, Matchfile, Gemfile.lock, platform lock files, schemes, flavors and environment configuration. Identify working directories and actual artifact paths before writing commands.
|
|
34
|
+
2. Establish the requested scope: pipeline setup, local verification, beta upload or production submission. Preserve existing lanes and signing conventions; do not replace the whole Fastfile with an example.
|
|
35
|
+
3. Separate validation from signed builds and uploads. Use pinned toolchains, lock-file-based caches, protected release jobs, secret storage and retained symbols as described in the shared CI/CD guide.
|
|
36
|
+
4. Adapt the selected reference to the detected platform. The imported fastlane guides describe iOS workflows; Android needs its own Gradle tasks, keystore and Play destination.
|
|
37
|
+
5. Check lane definitions, dependencies, action parameters and workflow syntax before execution. Run the project's relevant local checks, then report what was verified locally and what still needs a CI or store run. A configured pipeline is not evidence of a successful upload.
|
|
38
|
+
|
|
39
|
+
## Applying the upstream examples
|
|
40
|
+
|
|
41
|
+
The fastlane references preserve the instructions from `greenstevester/fastlane-skill`; their frontmatter was removed and the Xcode Cloud link relocated. Read them as examples, with these integration rules:
|
|
42
|
+
|
|
43
|
+
- Use the project's Ruby/Bundler/fastlane versions and `bundle exec fastlane` when a Gemfile exists. Verify compatibility from the lock file and current fastlane documentation rather than applying the upstream blanket claim about Bundler 4 or replacing the installation with Homebrew.
|
|
44
|
+
- Resolve `/setup-fastlane` and references to the `match`, `beta`, `release` and `snapshot` skills through the table above. These are references, not separately installed commands. Embedded `!` shell snippets and `${ARGUMENTS}` placeholders are upstream notation, not automatic preflight results.
|
|
45
|
+
- Inspect each lane before invoking it: the setup and Match examples define different `release` behavior. Confirm the exact tested build rather than submitting whichever build is newest. Existing session authorization determines whether builds, uploads, store submission or automatic release are in scope.
|
|
46
|
+
- Keep Match read-only in CI. Certificate revocation (`match nuke`), simulator erasure, package removal and screenshot-directory replacement are destructive recovery examples, not routine setup steps; diagnose first and require explicit authorization for those actions.
|
|
47
|
+
- Verify action options with the installed version's help or official documentation. In particular, check the `app_store_connect_api_key` action's content parameter rather than copying the Xcode Cloud example's `key:` blindly. Never print private keys or passwords.
|
|
48
|
+
- Confirm current screenshot dimensions and accepted devices with Apple's linked specifications and installed simulators. Treat processing/review times and StoreKit storefront behavior as claims to verify, not guarantees. Screenshot fixtures must represent the product accurately.
|
|
49
|
+
- The Xcode Cloud guide describes lifecycle scripts but does not ship them. Create or inspect those scripts for the actual project; do not assume the setup guide generated them. Follow the team's configured triggers and managed signing, and avoid rebuilding or uploading the same artifact twice.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Android CI
|
|
2
|
+
|
|
3
|
+
Read the [shared pipeline guide](../../mobile-release/references/ci-cd.md) and [Android release reference](../../mobile-release/references/android.md).
|
|
4
|
+
|
|
5
|
+
- Resolve the Gradle wrapper, JDK, module, variant and signing configuration from the project. Run its existing lint and test tasks before the release bundle task.
|
|
6
|
+
- Keep the upload keystore and Play credentials in CI secrets; untrusted pull requests must not receive them. Preserve the distinction between the upload key and Play App Signing.
|
|
7
|
+
- Use the actual AAB path and package identifier in the Android lane. The imported iOS `gym`, `pilot`, `match` and `snapshot` examples do not implement Android builds or uploads.
|
|
8
|
+
- Upload through the project's fastlane Play lane with an explicit track and release status. Retain the exact AAB, mapping and native symbols. Coordinate version codes across concurrent runs and retries.
|