Search code examples
androidgoogle-developers-consolein-app-subscriptionplay-billing-library

Google Play Console Subscriptions Update


Since May 2022 Google has updated its billing system. And now we have multiple base plans and offers. It looks complicated and not so solid as it was before. Maybe it's more flexible, but a lot of questions arise and there is no good documentation for common cases. For example:

How to create a subscription, when at first user has a free trial and after trial user is billed for subscription. After that subscription is renewed automatically and user is billed in advance for new period. (X days trial->user is billed->Y days subscription->user is billed->Y days subscription)

This case was really easy to setup on previous version of Google Play Billing, but now it's not obvious.

Thanks everyone in advance.


Solution

  • Considering you'll want to create a renewing subscription with X days trial.

    1. Create a base plan with the price after free trial and required billing period (e.g. yearly). Select Auto-renewing for renewal time.

    2. Create an offer for the base plan. Add a phase with Free trial type and specify duration of that phase. Basically it means that such offer will contain free trial phase followed by regular billing phase.

    3. You'll receive SubscriptionOfferDetails for that particular offer (along with base plan offer details) when querying for subscription product. This offer will contain 2 phases (PricingPhase): one for free trial phase, second for regular phase