RevenueCat Android SDK v6 is here!! 😻
This latest release updates the SDK to use BillingClient 5. This version of BillingClient brings an entire new subscription model which has resulted in large changes across the entire SDK.
Migration Guides
-
See the full list of API changes in our v6 migration doc
-
See Android Native - 5.x to 6.x Migration for a
more thorough explanation of the new Google subscription model announced with BillingClient 5 and how to take
advantage of it in V6. This guide includes tips on product setup with the new model.
Note: This release is based off of 6.0.0-rc.1
. Developers migrating from that version shouldn't see any changes.
API changes:
There have been a lot of changes since v5!
Here are the highlights:
Purchasing API changes
Purchases are now configured using PurchaseParams.Builder()
. The builder is constructed with either a Package
,Product
, or SubscriptionOption
and an Activity
. The builder then has methods for setting the product change
parameters (oldProductId
and googleProrationMode
).
To initiate a purchase, simply pass the built PurchaseParams
and your PurchaseCallback
to the purchase()
method.
Applying offers on a purchase
In V5, a Package
or StoreProduct
represented a single purchaseable entity, and free trials or intro offers would
automatically be applied if the user was eligible.
New SubscriptionOption
concept
Now, in v6, a Package
or StoreProduct
represents a duration of a subscription and contains all the ways to
purchase that duration -- any offers and its base plan. Each of these purchase options are SubscriptionOption
s.
When passing a Package
or StoreProduct
to purchase()
, the SDK will use the following logic to choose whichSubscriptionOption
to purchase:
-
- Filters out offers with "rc-ignore-offer" tag
-
- Uses
SubscriptionOption
with the longest free trial or cheapest first phase
- Uses
-
- Falls back to base plan
For more control, create your PurchaseParams.Builder
with the desired SubscriptionOption
.
To view new release, visit https://github.com/RevenueCat/purchases-android/releases/tag/6.0.0