Flutter: get past purchases on iOS


Everything is working on Android with the new implementation of in_app_purchase (https://pub.dev/packages/in_app_purchase) but on iOS I don’t get past purchases. Following the documentation I don’t see anything special.

My code is:

final Stream<List<PurchaseDetails>> purchaseUpdated =

      _subscription = purchaseUpdated.listen((purchaseDetailsList) {
        if (purchaseDetailsList.isEmpty) {
          Provider.of<AdState>(context, listen: false).toggleAds(context, true);
        } else {
          Provider.of<AdState>(context, listen: false)
              .toggleAds(context, false);
      }, onDone: () {
      }, onError: (error) {
        // handle error here.


It just doesn’t go in and if I try to buy same product I get this error:

There is a pending transaction for the same product identifier. Please
either wait for it to be finished or finish it manually using
completePurchase to avoid edge cases


I opened a ticket on the repo and it was fixed on version 1.0.9:

Answered By – Dani

Answer Checked By – Terry (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *