Apple Inapp payement response handling

i'm integrating In-App Purchases in our Flutter app using the official in_app_purchase plugin. We are currently testing consumable purchases and facing issues with the way events are delivered from StoreKit to the app.

Implementation details

I initiate the purchase with:

await InAppPurchase.instance.buyConsumable(purchaseParam: purchaseParam);

I listen for purchase updates with: final Stream<List<PurchaseDetails>> purchaseUpdated = inAppPurchase.purchaseStream;

_subscription = purchaseUpdated.listen((purchaseDetailsList) {

_handlePurchaseUpdates(purchaseDetailsList);

}, onError: (Object error) {

updateApplePaymentStatus(isSuccess: false, response: jsonEncode(error.toString()));

}, onDone: () {

_subscription.cancel();

});

Issues Observed

  1. Control on purchase button event
  • As soon as the user taps the purchase button, the App Store purchase sheet is shown.

  • Question: Is there a way to intercept control at this point (before showing the sheet) to perform additional checks or logging?

  1. Cancelled payment after UPI intent
  • In our testing with UPI payment flows (UPI intent triggered from Apple Pay/linked payment method), if the user cancels the payment from the external flow, we don’t see a clear event in purchaseStream.

  • Question: How can we reliably capture this cancellation status on the app side?

  1. Event timing after successful purchase
  • Currently, the purchaseStream event is only triggered after the StoreKit purchase confirmation popup has been dismissed by the user.

  • Question: Is there a way to capture the event earlier (i.e., right after StoreKit confirms payment success), so we can update our backend and UI without waiting for popup dismissal?

Request

We would appreciate guidance on:

  1. Best practices for intercepting purchase initiation before the StoreKit sheet.

  2. Recommended way to detect and handle cancelled payments (especially in UPI flows) managed on frondend side.

  3. Whether it is possible to receive successful purchase events without waiting for the user to dismiss the confirmation dialog.

Thank you for your support.

Apple Inapp payement response handling
 
 
Q