android-inapp-billing-v3 icon indicating copy to clipboard operation
android-inapp-billing-v3 copied to clipboard

[Critical Bug] USER_CANCELLED is no longer triggered when users close the iAP overlay without purchasing

Open max-critcrew opened this issue 2 years ago • 4 comments

Hey everyone,

we just updated our game to the latest version ('com.anjlab.android.iab.v3:library:2.0.3') and now the following listener method is no longer being called when the user cancels the purchase overlay:

  @Override
  public void onBillingError(int errorCode, Throwable error) {
    /*
    * Called when some error occurred. See Constants class for more details
    * 
    * Note - this includes handling the case where the user canceled the buy dialog:
    * errorCode = Constants.BILLING_RESPONSE_RESULT_USER_CANCELED
    */
  }

I've tried breakpoints in all kinds of methods to see if the cancellation is triggered anywhere - but it seems like cancelled purchases are no longer triggered at all. This is quite a big problem for us, since we've been showing a loading indicator and removed it again in the cancelled-callback.

This is reproduced live on the Google Play Store (unfortunately, I didn't catch it in testing). But it also happens in debug builds with license testers, etc.

max-critcrew avatar Feb 02 '22 08:02 max-critcrew

It seems like the information is only coming through here now, but you can't access these information without modifying the library (as far as I understand it so far):

public void onPurchasesUpdated(@NonNull BillingResult billingResult,
									@Nullable List<Purchase> purchases)

max-critcrew avatar Feb 02 '22 08:02 max-critcrew

@max-critcrew the community here would appreciate if you can provide a patch/PR for this issue

serggl avatar Feb 02 '22 08:02 serggl

@serggl I would love to, but I'm not entirely sure if I really understand the details of the library completely. I just figured out that the cancel event is no longer fired, but you can get it somewhere else. I have no idea if that only happens on certain android version - or if this was tested by the main developers of this library.

It would be amazing if somebody who wrote this part of the code could look at it and then provide an update.

max-critcrew avatar Feb 02 '22 08:02 max-critcrew

@serggl Pull request issued: https://github.com/anjlab/android-inapp-billing-v3/pull/517

max-critcrew avatar Feb 02 '22 17:02 max-critcrew