This release updates com.android.billingclient:billing
library from version 4 to version 6.
While your apps will probably continue to work, you still need to follow steps from official
upgrade guide https://developer.android.com/google/play/billing/migrate-gpblv6 to make sure you're
ready for future library updates from Google
Starting from Nov 1, 2021 Google will stop supporting v2 billing client library used as a dependency here. This library was upgraded accordingly (thanks to @Equin and @showdpro), but this led to some major braking changes:
- These methods were renamed:
getSubscriptionTransactionDetails
renamed togetSubscriptionPurchaseInfo
isValidTransactionDetails
renamed toisValidPurchaseInfo
- Consume/purchase related methods to not accept
developerPayload
argument anymore (dropped support by Google). If you used it - you'll need to find the workaroud - Some synchronous methods were dropped in favour of their asynchronous versions (which have success/failure callback as their last argument):
- use
consumePurchaseAsync
instead ofconsumePurchase
- use
loadOwnedPurchasesFromGoogleAsync
instead ofloadOwnedPurchasesFromGoogle
- use
getPurchaseListingDetailsAsync
instead ofgetPurchaseListingDetails
- use
getSubscriptionListingDetailsAsync
instead ofgetSubscriptionListingDetails
- use
- Deprecated
TransactionDetails
class has been removed. Please usePurchaseInfo
instead, here is the property mapping:- TransactionDetails (productId) -> PurchaseInfo (purchaseData.productId)
- TransactionDetails (orderId) -> PurchaseInfo (purchaseInfo.purchaseData.orderId)
- TransactionDetails (purchaseToken) -> PurchaseInfo (purchaseInfo.purchaseData.purchaseToken)
- TransactionDetails (purchaseTime) -> PurchaseInfo (purchaseInfo.purchaseData.purchaseTime)
handleActivityResult
method was removed, you don't need to override your app'sonActivityResult
anymore- Some billing flow related constants were removed from
Constants
class (BILLING_RESPONSE_*
constants). if your app relies on those - useBillingClient.BillingResponseCode.*
constants instead
The workaround below for the promo codes should no longer be valid. Promo codes should work just fine right out of the box
If you were supporting promo codes and faced troubled described in #156, you will need to change your workaround code:
errorCode == Constants.BILLING_ERROR_OTHER_ERROR && _billingProcessor.loadOwnedPurchasesFromGoogle() && _billingProcessor.isPurchased(SKU)
errorCode
needs to be changed to Constants.BILLING_ERROR_INVALID_DEVELOPER_PAYLOAD