Skip to content

[in_app_purchase] Cannot start a new purchase after cancelling on iOS 14 #66886

Closed
@zodiark23

Description

@zodiark23

Since iOS 14 I can't seem to finishTransaction for failed purchases. This will happen if you buy a product then cancel it, this one will stay on SKPaymentTransactionQueue. However re-running the debugger will clear out the transactions.

Steps to reproduce:

  1. Buy a product
  2. Cancel the payment screen.
  3. Buy the product again, nothing will happen (Payment Dialog will not pop out)

I tried this with in_app_purchase v0.3.4+8 and v.0.3.4+9 same thing.

Previously before iOS 14 this is not happening. Need help please.

Previously just by calling .completePurchase() for iOS its working properly.
I'm also clearing the SKTransactionQueue with this code

Future<void> clearIOSTransactions() async {
    // clear the transaction queue for failed completeTransaction or finishTransaction
    final transactions = await SKPaymentQueueWrapper().transactions();
    print("SkTransactionCount: ${transactions.length}");
    for (final transaction in transactions) {
      if (transaction.transactionState !=
          SKPaymentTransactionStateWrapper.purchasing) {
        await SKPaymentQueueWrapper().finishTransaction(transaction);
      }
    }
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    e: OS-version specificAffects only some versions of the relevant operating systemp: in_app_purchasePlugin for in-app purchasepackageflutter/packages repository. See also p: labels.platform-iosiOS applications specifically

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions