Skip to main content
Question

Flutter PaywallView onPurchaseError callback not getting called.


Forum|alt.badge.img

As far as I understand, the onPurchaseError callback on the PaywallView gets called whenever any of these errors occur: https://www.revenuecat.com/docs/test-and-launch/errors#purchasing-errors.

 

I’ve been testing this by canceling a purchase. But as far as I can tell nothing inside the function call is getting executed:

onPurchaseError: (error) {

log(“Hello World”);

}

 

If I look into my logs, I can see that the error was thrown correctly though:
 

E/[Purchases] - ERROR( 4764): 🤖‼️ BillingWrapper purchases failed to update: DebugMessage: . ErrorCode: USER_CANCELED.null

E/[Purchases] - ERROR( 4764): 🤖‼️ PurchasesError(code=PurchaseCancelledError, underlyingErrorMessage=Error updating purchases. DebugMessage: . ErrorCode: USER_CANCELED., message='Purchase was cancelled.')

 

I’m using:
> purchases_flutter 8.6.1
> purchases_ui_flutter 8.6.1

 

SIDE NOTE:

Observations apply to both V1 and V2 paywalls.

So far, all that I can only confidently say is that onPurchaseComplete and onRestoreComplete are working as intended

Using displayCloseButton and onDismiss doesn’t show a close button either.

Haven’t tested onRestoreError yet.

2 replies

jeffrey_bunn
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • 248 replies
  • March 17, 2025

@david_harmonyV Thanks for reporting this, as your expectations are correct. The onPurchaseCancelled method is missing from the Flutter SDK - our engineering team will work to add this shortly.


jeffrey_bunn
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • 248 replies
  • March 17, 2025

@david_harmonyV I’ve just created a PR that adds this to the Flutter SDK. 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings