Listener interface for purchase updates which happen when, for example, the user buys something within the app or by initiating a purchase from Google Play Store.
onPurchasesUpdated(BillingResult billingResult, List<Purchase> purchases)
Implement this method to get notifications for purchases updates.
public abstract void onPurchasesUpdated (BillingResult billingResult, List<Purchase> purchases)
Implement this method to get notifications for purchases updates. Both purchases initiated by your app and the ones initiated outside of your app will be reported here.
Warning! All purchases reported here must either be consumed or acknowledged. Failure
to either consume (via
BillingClient.consumeAsync(ConsumeParams, ConsumeResponseListener)) or acknowledge (via
BillingClient.acknowledgePurchase(AcknowledgePurchaseParams, AcknowledgePurchaseResponseListener)) a purchase will result in that purchase being refunded.
Please refer to the integration guide for
BillingResult: Result of the purchase update.
BillingClient.BillingResponseCode.ITEM_ALREADY_OWNED if the user already owns the item
BillingClient.BillingResponseCode.ITEM_UNAVAILABLE if the item is
not available to be purchased, and
if the user dismissed the purchase flow.
List: List of updated purchases if present.