rc-alternative-billing

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Alternative Billing Programs

替代计费方案

Google runs several programs that let you collect payment outside standard Play Store billing. This skill tells you which pieces the RevenueCat Android SDK covers today and which ones you implement yourself against the Play Billing Library.
Per the handbook chapter, RevenueCat has limited support for these programs as of SDK 9.x. Treat that as the status of record; check the RevenueCat changelog for any newer SDK releases before you start work.
Google推出了多项方案,允许你绕过标准Play Store计费流程收取费用。本技能将说明RevenueCat Android SDK目前涵盖哪些内容,以及哪些部分需要你直接基于Play Billing Library自行实现。
根据手册章节内容,截至SDK 9.x版本,RevenueCat对这些方案的支持有限。请以此为当前记录状态;开始工作前,请查看RevenueCat更新日志确认是否有更新的SDK版本。

Phase 1: Discovery

第一阶段:调研

Answer these before writing any code.
QuestionWhy it matters
Which program are you targeting?User Choice Billing, Alternative Billing Only, External Offers, and External Payment Links each have different Play requirements.
Is your app eligible in the target region?Google gates these programs by country and app category. You enroll through Play Console, not through RevenueCat.
Are you using RevenueCat Web Billing instead?RevenueCat's web checkout is a separate product from Google's alternative billing. Do not conflate the two.
Which RevenueCat SDK version are you on?Support evolves per release. What is unsupported in SDK 9.x may land later.
If you actually want to sell subscriptions via a RevenueCat-hosted web checkout, that is not one of Google's alternative billing programs. Use
Offering.webCheckoutURL
or
Package.webCheckoutURL
:
kotlin
val pkg = offerings.current?.monthly
pkg?.webCheckoutURL?.let { url ->
    startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url.toString())))
}
After the user completes that purchase on the web, they redeem it in-app via deep link handling.
在编写任何代码前,请先回答以下问题。
问题重要性
你要针对哪个方案?User Choice Billing、Alternative Billing Only、External Offers和External Payment Links各自有不同的Play要求。
你的应用在目标地区是否符合资格?Google会根据国家和应用类别限制这些方案的使用。你需通过Play Console注册,而非RevenueCat。
你是否在使用RevenueCat Web Billing?RevenueCat的网页结账功能是独立于Google替代计费的产品。请勿将二者混淆。
你使用的是哪个版本的RevenueCat SDK?支持情况随版本更新而变化。SDK 9.x中不支持的功能可能在后续版本中实现。
如果你确实想通过RevenueCat托管的网页结账销售订阅服务,那不属于Google替代计费方案的范畴。请使用
Offering.webCheckoutURL
Package.webCheckoutURL
kotlin
val pkg = offerings.current?.monthly
pkg?.webCheckoutURL?.let { url ->
    startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url.toString())))
}
用户在网页完成购买后,可通过深度链接处理在应用内兑换。

Phase 2: Plan

第二阶段:规划

Decide which of the two paths fits.
Path A: Wait for SDK support. If your launch timeline is flexible, watch the RevenueCat changelog and docs for first-class support of the specific program you need. This avoids running raw Play Billing Library code alongside RevenueCat.
Path B: Hand roll the integration. If you must ship now, implement the Play Billing Library APIs for the target program directly. The RevenueCat SDK owns the
BillingClient
instance, so running raw
BillingClient
calls alongside it needs care.
For Path B, set completion ownership so RevenueCat does not interfere with acknowledgement of purchases you are managing:
kotlin
Purchases.configure(
    PurchasesConfiguration.Builder(context, apiKey)
        .purchasesAreCompletedBy(PurchasesAreCompletedBy.MY_APP)
        .build()
)
Planning checklist:
  • Confirmed the Play program and regional eligibility in Play Console.
  • Read the current RevenueCat docs and changelog for the SDK version you ship.
  • Chose Path A or Path B with a clear reason.
  • If Path B, identified which flows RevenueCat still drives and which you drive.
确定以下两种路径中哪一种更适合你。
路径A:等待SDK支持。如果你的发布时间线灵活,请关注RevenueCat更新日志和文档,等待所需特定方案的原生支持。这样可以避免在RevenueCat之外运行原生Play Billing Library代码。
路径B:自行实现集成。如果必须立即发布,请直接针对目标方案实现Play Billing Library的API。由于RevenueCat SDK拥有
BillingClient
实例,因此在其旁运行原生
BillingClient
调用需要格外小心。
对于路径B,请设置完成所有权,确保RevenueCat不会干扰你所管理的购买订单的确认流程:
kotlin
Purchases.configure(
    PurchasesConfiguration.Builder(context, apiKey)
        .purchasesAreCompletedBy(PurchasesAreCompletedBy.MY_APP)
        .build()
)
规划检查清单:
  • 已在Play Console确认Play方案及区域资格。
  • 已阅读你当前使用的SDK版本对应的RevenueCat文档和更新日志。
  • 已明确选择路径A或路径B并说明理由。
  • 如果选择路径B,已确定哪些流程仍由RevenueCat驱动,哪些由你自行驱动。

Phase 3: Execute

第三阶段:实施

What RevenueCat's SDK currently supports in this space, per the chapter:
FlowSDK coverage
RevenueCat Web Billing via
Offering.webCheckoutURL
/
Package.webCheckoutURL
Supported. Not a Google alternative billing program.
User Choice BillingNo dedicated SDK APIs. Implement via Play Billing Library alongside RevenueCat.
Alternative Billing OnlyNo dedicated SDK APIs. Implement via Play Billing Library alongside RevenueCat.
External OffersNo dedicated SDK APIs. Implement via Play Billing Library alongside RevenueCat.
External Payment LinksNo dedicated SDK APIs. Implement via Play Billing Library alongside RevenueCat.
When you ship Path B, use
PurchasesAreCompletedBy.MY_APP
so acknowledgement stays in your hands for the purchases you manage, and leave the standard Play Store purchases to the RevenueCat SDK.
Verification steps:
  • Standard Play Store purchases still flow through RevenueCat and appear in the dashboard.
  • Purchases made through the alternative billing path reach your backend and are reconciled with RevenueCat subscriber state.
  • Acknowledgement happens exactly once per purchase, with no double-handling between your code and the SDK.
根据本章内容,RevenueCat SDK目前在该领域的支持情况如下:
流程SDK覆盖情况
通过
Offering.webCheckoutURL
/
Package.webCheckoutURL
实现的RevenueCat Web Billing
支持。不属于Google替代计费方案。
User Choice Billing无专用SDK API。需结合RevenueCat通过Play Billing Library实现。
Alternative Billing Only无专用SDK API。需结合RevenueCat通过Play Billing Library实现。
External Offers无专用SDK API。需结合RevenueCat通过Play Billing Library实现。
External Payment Links无专用SDK API。需结合RevenueCat通过Play Billing Library实现。
当你采用路径B发布时,请使用
PurchasesAreCompletedBy.MY_APP
,确保你所管理的购买订单的确认流程由你掌控,而标准Play Store购买订单仍由RevenueCat SDK处理。
验证步骤:
  • 标准Play Store购买订单仍通过RevenueCat处理并显示在控制台中。
  • 通过替代计费路径完成的购买订单已送达你的后端,并与RevenueCat订阅者状态保持一致。
  • 每个购买订单仅确认一次,你的代码与SDK之间不会出现重复处理。

References

参考资料