This patch updates the plugin to use the latest 4.0 release of the Play
Billing Library. It includes adjustments to account for API changes and adds
some missing functionality to the plugin.
API Changes
The Play Billing Library has deprecated the queryPurchases function and
replaced it with queryPurchasesAsync. The queryPurchases method of the
plugin has changed as a result. Instead of directly returning the Dictionary
purchases object, it is now sent as a parameter of the
query_purchases_response signal which fires when queryPurchasesAsync
completes.
Feature additions
Purchase Dictionary
The Purchase dictionary contains two new keys:
quantity Quantity of purchase item (retrieved with Purchase.getQuantity())
skus Array of skus included in purchase (retrieved with Purchase.getSkus())
The existing sku key is still present, but will only include the first sku
of a multi-sku purchase.
Obfuscated id parameters
Methods to set obfuscated profile and account id information have been added:
setObfuscatedAccountIdsetObfuscatedProfileId
Both take a single string parameter that may not be greater than 64 characters.
If set, the obfuscated data will be attached to the purchase parameter data.
Billing resume
The plugin now sends a billing_resume signal when the plugin receives a
resume event. Best practice is to recheck for purchases on a resume to handle
purchases that may have occurred or changed from pending while outside the app.
Connection state
A getConnectionState method has been added to retrieve the ConnectionState
value of the Play Billing Library.
Update subscriptions
An updateSubscription method has been added to launch the subscription flow
to upgrade or downgrade an existing subscription. The method returns a status
dictionary matching the format returned by `purchase. The method takes three
parameters:
Purchase Token of previous subscription (String)
Sku (product ID) of the new subscription (String)
Subscription proration mode (Int, see BillingFlowParams.ProrationMode)
Subscription price change confirmation
A confirmPriceChange method has been added to launch the subscription price
change confirmation flow. It takes a single parameter: the Sku (product ID) of
the affected subscription. The method returns a status dictionary that
matches the format used by purchase. The result of the confirmation is
sent using the price_change_acknowledged signal which returns the
BillingResult.getResponseCode() result as a parameter.
Play Billing Library plugin 1.1 patch notes
This patch updates the plugin to use the latest 4.0 release of the Play Billing Library. It includes adjustments to account for API changes and adds some missing functionality to the plugin.
API Changes
The Play Billing Library has deprecated the
queryPurchases
function and replaced it withqueryPurchasesAsync
. ThequeryPurchases
method of the plugin has changed as a result. Instead of directly returning the Dictionary purchases object, it is now sent as a parameter of thequery_purchases_response
signal which fires whenqueryPurchasesAsync
completes.Feature additions
Purchase Dictionary
The Purchase dictionary contains two new keys:
quantity
Quantity of purchase item (retrieved withPurchase.getQuantity()
)skus
Array of skus included in purchase (retrieved withPurchase.getSkus()
) The existingsku
key is still present, but will only include the first sku of a multi-sku purchase.Obfuscated id parameters
Methods to set obfuscated profile and account id information have been added:
setObfuscatedAccountId
setObfuscatedProfileId
Both take a single string parameter that may not be greater than 64 characters. If set, the obfuscated data will be attached to the purchase parameter data.Billing resume
The plugin now sends a
billing_resume
signal when the plugin receives a resume event. Best practice is to recheck for purchases on a resume to handle purchases that may have occurred or changed from pending while outside the app.Connection state
A
getConnectionState
method has been added to retrieve theConnectionState
value of the Play Billing Library.Update subscriptions
An
updateSubscription
method has been added to launch the subscription flow to upgrade or downgrade an existing subscription. The method returns a status dictionary matching the format returned by `purchase. The method takes three parameters:BillingFlowParams.ProrationMode
)Subscription price change confirmation
A
confirmPriceChange
method has been added to launch the subscription price change confirmation flow. It takes a single parameter: the Sku (product ID) of the affected subscription. The method returns a status dictionary that matches the format used bypurchase
. The result of the confirmation is sent using theprice_change_acknowledged
signal which returns theBillingResult.getResponseCode()
result as a parameter.