协作头脑风暴
brainstorming
在实现前澄清需求、探索设计选择,并形成清晰的开发方向。
capacitor-in-app-purchases【开发与工程】Guides the agent through setting up in-app purchases in Capacitor apps. Covers App Store Connect and Google Play Console product configuration, plugin selection (Capawesome Purchases vs. RevenueCat), plugin installation and platform setup, purchase flows for subscriptions and consumables, receipt validation, restore purchases, handling unfinished tra…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Set up in-app purchases and subscriptions in Capacitor apps, covering store configuration, plugin integration, purchase flows, receipt validation, and testing.
android/, ios/), package.json dependencies, and Capacitor version. Only ask the user when something cannot be detected.Two hosted MCP servers serve the current documentation, so both are always ahead of the guidance bundled with this skill:
capacitor.config file, the native Android and iOS projects, and the official plugin APIs.Both expose search_docs and get_doc_page, so pick the server by topic before calling either.
search_docs on the server that owns the topic and read the matching page with get_doc_page before applying the guidance below. Where the two disagree, follow the documentation.claude mcp add --transport http capawesome "https://mcp.capawesome.io/mcp"
claude mcp add --transport http capacitor "https://capacitor-mcp.capawesome.io/mcp"
Neither server needs an account or a token for documentation. See the capawesome-mcp and capacitor-mcp skills for full setup, including the Capawesome Cloud tools.
Auto-detect the following by reading project files — do not ask the user for information that can be inferred:
android/, ios/). These are the platforms to configure.@capacitor/core version from package.json.@capawesome-team/capacitor-purchases, @revenuecat/purchases-capacitor, or any other in-app purchase plugin is already in package.json. If found, inform the user and ask whether to continue with the existing plugin or switch.Skip if ios/ does not exist.
Read references/app-store-connect-setup.md and guide the user through creating in-app purchase products and subscriptions in App Store Connect. This covers:
Skip if android/ does not exist.
Read references/google-play-console-setup.md and guide the user through creating in-app purchase products in Google Play Console. This covers:
Ask the user which plugin to use:
@capawesome-team/capacitor-purchases) — Lightweight, no third-party backend dependency. Requires a Capawesome Insiders license. Server-side receipt validation is the developer's responsibility.@revenuecat/purchases-capacitor) — Full backend service with server-side receipt validation, entitlement management, analytics, and integrations. Requires a RevenueCat account.Default recommendation: Capawesome Purchases for apps that already have a backend for receipt validation or want to avoid third-party dependencies. RevenueCat for apps that want managed receipt validation and subscription analytics out of the box.
Based on the user's choice in Step 4:
references/capawesome-purchases-setup.md and follow the installation and platform configuration steps.references/revenuecat-setup.md and follow the installation and platform configuration steps.Based on the user's plugin choice:
references/capawesome-purchases-implementation.md and add the purchase code to the project.references/revenuecat-implementation.md and add the purchase code to the project.Adapt imports and code structure to match the user's framework (Angular, React, Vue, etc.).
The implementation covers:
Ask the user which optional features to enable:
For each selected feature, read the corresponding implementation reference file and apply the relevant code.
Read references/testing.md and guide the user through testing in-app purchases on both platforms. This covers:
npx cap sync
Build and run on each platform to verify purchases work end-to-end:
npx cap run android
npx cap run ios
purchaseProduct() returns error on Android: Verify google-services.json is present and the Google Play Billing Library version is compatible. Check $googlePlayBillingVersion in android/variables.gradle.transaction.verificationResult. On Android, validate transaction.token, transaction.originalJson, and transaction.signature against the Google Play Developer API.syncTransactions() displays a system authentication dialog — it must be called in response to an explicit user action (e.g., a "Restore Purchases" button tap). On Android, it runs silently.finishTransaction() not called: Unfinished transactions block future purchases on some platforms. Always call finishTransaction() after delivering content. Check for unfinished transactions at every app launch.npx cap sync was run after installation. For Capawesome Purchases, verify the Capawesome npm registry is configured.@capacitor/core version in package.json.capacitor-plugins — For general Capacitor plugin installation and configuration, including the Capawesome Purchases and RevenueCat plugins.capawesome-cloud — For app store publishing after in-app purchases are configured.capawesome-mcp — Connect an MCP client to the hosted Capawesome MCP server for always-current documentation and Capawesome Cloud management.