What’s New in Google Play Billing Library 6.0.

During its annual I/O conference, Google announced the release of the new Google Play Billing Library 6.0. In this article, we’ll make a brief overview of the updates, as starting on August 2, 2023, all new apps should utilize Billing Library 5.0 or a newer version, and all existing apps should migrate to Google Play Billing Library 5.0 or higher till the 1st of November, 2023.

What’s New in Google Play Billing Library 6.0.

Google Play Billing Library 6 expands upon the subscription functionalities introduced in version 5 and introduces additional enhancements. 

Change a User’s Subscription Purchases

In Play Billing Library 5 and earlier, ProrationMode was used to apply changes to a user’s subscription purchases, such as upgrades or downgrades. This has been deprecated and replaced with ReplacementMode in version 6. The content itself remains unchanged, only the titles of possible dimensions have been changed.

Handle Subscription Price Changes

The previously deprecated queryPurchases and launchPriceConfirmationFlow API have been removed in Play Billing Library 6.

Handle Google Play Billing Library Errors

In Play Billing Library 6, a new NETWORK_ERROR code has been added to indicate problems with the network connection between the user’s device and the Google Play system. This code has replaced SERVICE_UNAVAILABLE, and SERVICE_UNAVAILABLE itself is a dimension that has taken the place of the deprecated SERVICE_TIMEOUT.

Handle Pending Transactions

Starting with version 6.0.0, the Play Billing Library does not create an order ID for pending purchases. For these purchases, the order ID is populated after the purchase is moved to the PURCHASED state. Make sure that your integration only expects an order ID after a transaction is fully completed. You can still use the purchase token for your records. For more information about handling pending purchases, see the Play Billing Library integration guide and the purchase lifecycle management guide.

Additional Logging

The Play Billing Library 6 release includes additional logging, which provides insight into API usage (such as success and failure) and service connection issues. This information will be used to improve the performance of the Play Billing Library and provide better support for errors.

How to Migrate to Google Play Billing Library 6.0.

To learn more about how to migrate to Google Play Billing Library 6.0, please read the official Google’s guide. You can also learn more on previous version of the library by the following article about Google Play Billing Library 5.0.