微算力 · API 导航与自营网关
API 接入 EN
未登录登录
💳

RevenueCat 跨平台订阅变现引擎

In-App Purchases · v1.0.0
这个包缺安装入口,装上也不会生效 缺 SKILL.md 或 frontmatter 不完整(BAD_NAME)。我们仍保留下载,方便你自行查看内容。
专业技能 安全 A 级 作者 ivangdavila 公开目录收录
974 下载 2 安装 4.2k 收藏 20 浏览

简介

RevenueCat 驱动的跨平台内购与订阅管理方案,覆盖 iOS StoreKit 2、Android Billing、Flutter,包含服务器校验、付费墙设计与订阅分析。

原始描述

Implement in-app purchases and subscriptions across iOS, Android, and Flutter with RevenueCat, paywalls, receipt validation, and subscription analytics.

通过你的 Agent 添加

安装目录:in-app-purchases/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。

点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。

或者手动安装

Claude Code~/.claude/skills/in-app-purchases/
Codex CLI~/.codex/skills/in-app-purchases/
DeepSeek Harness~/.agents/skills/in-app-purchases/

包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可; 目录名不用换,也不要把包直接解压到 skills 根目录。 技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。

中文使用说明 来自收录源

核心用法

本 Skill 提供了一套完整的应用内购买(IAP)与订阅变现架构,支持原生开发(iOS StoreKit 2、Google Play Billing)及跨平台方案(RevenueCat、Adapty、Qonversion)。核心工作流包括:

  1. 架构选型:根据团队规模与 MTR(月度追踪收入)选择 Native 直连、第三方 SDK 管理或自建混合方案
  2. 产品配置:区分消耗型、非消耗型、自动续订订阅等产品类型,适配双平台差异
  3. 交易处理:实现完整状态机(Purchased/Pending/Failed/Deferred/Refunded/Grace period/Billing retry)
  4. 服务器校验:强制对接 App Store Server API / Google Play Developer API,杜绝客户端伪造
  5. 订阅生命周期:监听 INITIAL_PURCHASE、RENEWAL、CANCELLATION、EXPIRATION 等 9+ 种事件,确保权限精准同步
  6. 付费墙优化:价值前置、价格锚定、免费试用突出、社交证明、A/B 测试
  7. 沙盒测试:利用压缩时间周期(1周→3分钟)快速验证续订、中断、升级场景

显著优点

  • 平台覆盖全面:iOS / Android / Flutter 三端统一 API,降低跨平台维护成本
  • RevenueCat 生态成熟:免费阈值高($2.5k MTR)、文档完善、Webhook 体系完整
  • 安全机制完备:强制服务器校验 + 事务完成确认,防止越狱/Root 绕过
  • 商业化细节到位:涵盖价格上调同意(iOS)、家庭共享、Restore 按钮合规等审核敏感点

潜在缺点与局限性

  • 第三方费用:RevenueCat 1%、Adapty 0.6%,高 MTR 应用需权衡自建成本
  • 平台锁定风险:深度依赖 RevenueCat 后迁移成本较高
  • 审核政策严格:苹果 15-30% 抽成、反引导条款、数字商品强制 IAP 限制商业模式灵活性
  • 测试复杂度:沙盒环境与生产环境行为差异、订阅时间压缩易漏测真实续订失败场景

适合人群

  • 需要快速上线订阅功能的初创团队(首选 RevenueCat/Adapty)
  • 已有用户基础、追求 100% 收入留存的中大型应用(评估 Native + 自建后端)
  • Flutter 跨平台开发者(避免重复实现双端逻辑)

常规风险

  • 合规风险:误放外部支付链接导致 App Store 下架
  • 收入损失:未处理 Grace Period 导致本可挽回的用户流失
  • 安全漏洞:仅客户端校验可被 trivial 绕过
  • 数据缺失:未接入订阅分析则无法优化 LTV

技能正文


name: In-App Purchases slug: in-app-purchases version: 1.0.0 description: Implement in-app purchases and subscriptions across iOS, Android, and Flutter with RevenueCat, paywalls, receipt validation, and subscription analytics. metadata: {"clawdbot":{"emoji":"💳","requires":{"bins":[]},"os":["linux","darwin","win32"]}}

When to Use

User needs to implement in-app purchases, subscriptions, paywalls, or monetization flows. Agent handles native APIs (StoreKit 2, Google Play Billing), cross-platform SDKs (RevenueCat, Adapty, Qonversion), paywall design, server verification, and subscription analytics.

Quick Reference

Topic File
iOS StoreKit 2 storekit.md
Android Billing google-play.md
Flutter packages flutter.md
RevenueCat SDK revenuecat.md
Platform comparison platforms.md
Server verification server.md
Paywall design paywalls.md
Subscription metrics analytics.md
Testing & sandbox testing.md

Core Rules

1. Choose Your Architecture

Approach When to Use Tradeoff
Native only Single platform, full control More code, no cross-platform sync
RevenueCat/Adapty Cross-platform, fast launch 1-2% fee, dependency
Hybrid Native + own backend Full control, more work

2. Platform SDKs (Managed)

Platform Pricing Best For
RevenueCat Free <$2.5k MTR, then 1% Most apps, best docs
Adapty Free <$10k MTR, then 0.6% Cost-conscious, A/B paywalls
Qonversion Free <$10k MTR, then 3% Simple setup
Superwall Paywall-focused Paywall A/B only
Glassfy Free <$10k, then 0.5% Budget option

3. Product Types

Type iOS Android Use Case
Consumable ✅ ✅ Credits, coins, lives
Non-consumable ✅ ✅ Unlock feature forever
Auto-renewable ✅ ✅ Subscriptions
Non-renewing ✅ ❌ Season pass, time-limited

4. Server Verification is Non-Negotiable

Never trust client-side validation alone:

  • iOS: App Store Server API with JWS verification
  • Android: Google Play Developer API
  • RevenueCat: Webhooks + REST API

5. Handle All Transaction States

State Action
Purchased Verify → grant → finish
Pending Wait, show pending UI
Failed Show error, don't grant
Deferred Wait for parental approval
Refunded Revoke immediately
Grace period Limited access, prompt payment
Billing retry Maintain access during retry

6. Subscription Lifecycle Events

Must handle all of these (native or via webhooks):

  • INITIAL_PURCHASE → grant access
  • RENEWAL → extend access
  • CANCELLATION → mark will-expire
  • EXPIRATION → revoke access
  • BILLING_ISSUE → prompt to update payment
  • GRACE_PERIOD → limited access window
  • PRICE_INCREASE → consent required (iOS)
  • REFUND → revoke + flag user
  • UPGRADE/DOWNGRADE → prorate

7. Restore Purchases Always

Required by App Store guidelines:

  • Prominent restore button
  • Works for logged-out users
  • Handles family sharing (iOS)
  • Cross-device sync

8. Paywall Best Practices

See paywalls.md for detailed patterns:

  • Show value before price
  • Anchor pricing (3 options, highlight middle)
  • Free trial prominent
  • Social proof if available
  • A/B test everything

9. Testing Strategy

Environment iOS Android
Dev/Debug StoreKit Config file License testers
Sandbox Sandbox accounts Internal testing
Production Real accounts Production

Sandbox subscription times:

  • 1 week → 3 minutes
  • 1 month → 5 minutes
  • 1 year → 1 hour

10. App Store Guidelines

  • No external payment links (anti-steering)
  • Must use IAP for digital goods
  • Physical goods/services can use Stripe
  • Reader apps have exceptions
  • 15-30% commission applies

Common Traps

  • Testing with real money → use sandbox/test accounts
  • Not finishing transactions → auto-refund (Android 3 days)
  • Hardcoding prices → always fetch from store (regional pricing)
  • Missing transaction observer → lose purchases made outside app
  • No server verification → trivially bypassable
  • Ignoring grace period → users churn when they could recover
  • Poor paywall UX → kills conversion regardless of price
  • Not tracking metrics → can't optimize what you don't measure
  • Forgetting restore button → App Store rejection
  • Not handling family sharing → confused users

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

mobile-developmentiosandroidfluttermonetizationin-app-purchaserevenuecatstorekitgoogle-play-billingsubscriptionserver-side-verification

同类 Skill