Play Billing Library 8 support in Purchases SDK v9.0.0

Google Play Billing Library 8 introduces multiple purchase options for one-time products, non-expiring subscriptions, improved error handling, and removes support for querying expired subscriptions and consumed products.

Jaewoong Eum
Published

Summary

Google Play Billing Library 8 introduces multiple purchase options for one-time products, non-expiring subscriptions, improved error handling, and removes support for querying expired subscriptions and consumed products. RevenueCat SDK v9.0.0 adds full support across Android, Kotlin Multiplatform, Flutter, and React Native, with key migration steps outlined for each platform to ensure compatibility and smooth upgrades.

Google recently announced the release of Google Play Billing Library 8, introducing new offer capabilities such as multiple purchase options for one-time products and support for non-expiring subscriptions, and introduced new Kotlin extensions.

In this article, we’ll walk through the key changes in Billing Library 8, what to keep in mind when migrating to the new RevenueCat SDK v9.0.0 for Android, Kotlin Multiplatform, Flutter, and React Native, and how to seamlessly integrate these updates into your project.

Note: The RevenueCat iOS SDK is not affected by these Google Play Billing updates.

What’s new in Google Play Billing v8

Version 8 of the Google Play Billing Library introduces a series of improvements aimed at simplifying product management and error handling for developers. The term “in-app items” has officially been replaced with “one-time products”, which now support multiple purchase options and offers, giving developers more flexibility when selling non-subscription items.

A key change is the enhancement to queryProductDetailsAsync(), which now returns information about products that couldn’t be fetched, including a product-level status code. This update also introduces a signature change in the onProductDetailsResponse() method, which requires adjustments to your implementation.

BillingClient now supports automatic service reconnection, eliminating the need to manually call startConnection() after disconnections. Additionally, launchBillingFlow() now includes sub-response codes for specific error cases, such as PAYMENT_DECLINED_DUE_TO_INSUFFICIENT_FUNDS.

As part of ongoing cleanup, several deprecated APIs have been officially removed in v8, including querySkuDetailsAsync(), queryPurchaseHistory(), and the older version of enablePendingPurchases().You can find the full list of updates in the official release notes.

What you need to know

If you’re planning to migrate to RevenueCat SDK v9.0.0—whether you’re working with Android, Kotlin Multiplatform, Flutter, or React Native—and already using RevenueCat SDKs for in-app purchases, there’s no need to stress over every detail. We’ve designed the migration to handle most of the complexity for you.

That said, it’s helpful to understand a few key concepts to ensure compatibility and a smooth integration. As part of the update, several deprecated APIs, such as those for querying expired subscriptions and consumed one-time products, have been removed. The release also introduces other important improvements and behavioral changes.

Play Billing library 8: No expired subscriptions or consumed one-time products

Play Billing Library 8 removes the ability to query expired subscriptions and consumed one-time products. For developers migrating from a non-RevenueCat implementation, this means the SDK will no longer be able to retrieve and send purchase data for those past transactions. However, this data can still be imported through a backend historical import, see the documentation for guidance.

This change does not impact developers who already manage all transactions through RevenueCat SDK, which applies to the vast majority of users.

Using the SDK with your own IAP code (previously observer mode)

Using the SDK alongside your own in-app purchase (IAP) code is still fully supported in RevenueCat SDK v9.0.0. Other than updating the SDK version, no additional changes are required. Just ensure that you’re also using Play Billing Library version 8 or higher.

Migration guides for SDK v9.0.0

You’ve seen what’s new in Google Play Billing v8 and the key considerations for upgrading to RevenueCat SDK v9.0.0. Now, let’s dive into the specific migration steps for each platform—Android, Kotlin Multiplatform, Flutter, and React Native—to help you transition smoothly.

Android

RevenueCat Android SDK v9 upgrades Kotlin to version 2.0.21 and sets the minimum supported Kotlin version to 1.8.0. If your project is using a Kotlin version below 1.8.0, this will be the most breaking change to address. Otherwise, if you’re already on Kotlin 1.8.0 or higher, no additional changes are needed and you can migrate to v9 seamlessly.

At the time of writing, version 9.1.1 has already been released, so if possible, we recommend updating to the latest version to take advantage of the most recent improvements and fixes.

Kotlin Multiplatform

RevenueCat KMP SDK 2.0.0+15.0.0 upgrades Kotlin to version 2.1.10, with a new minimum requirement of Kotlin 2.1.0 or higher. If you’re using an older Kotlin version, you’ll need to update it to proceed. Otherwise, if you’re already on Kotlin 2.1.0+, no further changes are necessary, and you can migrate to v9 without any issues.

React Native

RevenueCat React Native SDK 9.0.0 updates Kotlin to version 2.0.21, with a new minimum requirement of Kotlin 1.8.0 or higher. If your project is using an older Kotlin version, you’ll need to upgrade. However, if you’re already using Kotlin 1.8.0 or above, no additional changes are required and you can migrate to v9 smoothly.

Flutter

RevenueCat Flutter SDK 9.0.0 raises the minimum Flutter SDK to 3.22.0 and the minimum Dart SDK to 3.4.0. If your project is using an older version of Flutter or Dart, you’ll need to upgrade. Otherwise, if you’re already on these versions or higher, no additional changes are needed and you can migrate to v9 without any issues.

Conclusion

In this article, you explored the key updates in Google Play Billing Library v8 and what to keep in mind when migrating to RevenueCat SDK v9.0.0 across each supported platform. Google typically announces a new version of the Play Billing Library each year—often around Google I/O—and keeping up with these changes across multiple platforms like Android and iOS can be a significant overhead in your engineering team.

That’s where RevenueCat comes in. We handle the complexity of billing migrations, platform updates, and SDK compatibility, so you can focus on what truly matters, building and growing your app.

As always, happy coding!
Jaewoong

You might also like

Share this post