finishTransaction
Complete a purchase transaction. Must be called after verifying the purchase to remove it from the queue.
iOS: Calls Transaction.finish(). Until you do, the same transaction replays through Transaction.updates on every app launch. Apple docs. Android: Acknowledges (acknowledgePurchase) for non-consumables/subscriptions or consumes (consumeAsync) for consumables. Google auto-refunds within 3 days if neither runs. Google docs.
Signature
swift
func finishTransaction(purchase: PurchaseInput, isConsumable: Bool?) async throwsParameters#
The transaction to close, plus an optional consumable flag:
purchase(required,Purchase) — The purchase / transaction to finalize. Must come fromrequestPurchaseorgetAvailablePurchases.isConsumable(optional,boolean, defaultfalse) — Android.trueconsumes the token (re-buyable like coins);falsejust acknowledges (non-consumables, subscriptions). iOS always callsTransaction.finish()regardless.
Returns#
Promise<void> — Resolves once the platform finalizes the transaction.
Throws#
When the platform finalize call fails.
Example
swift
try await OpenIapModule.shared.finishTransaction(
purchase: purchase,
isConsumable: false
)