iOS latestTransactionIOS

Get the most recent transaction for a product (iOS 15+, macOS 14+).

Wraps Transaction.latest(for:) — returns the most recent verified transaction (success or refund). See the Apple StoreKit reference.

Signature

swift
func latestTransactionIOS(sku: String) async throws -> PurchaseIOS?

Parameters#

  • sku (required, string) — Product identifier.

Returns#

Promise<PurchaseIOS | null> — iOS purchase shape, or null if the SKU has no matching transaction.

Example

swift
let tx = try await OpenIapModule.shared.latestTransactionIOS(sku: "com.app.premium")