How to get a Transaction with StoreKit 2 to present a refund sheet?

Viewed 560

I purchase a consumable product with StoreKit 2 using my device with Xcode:

let result = try await product.purchase()

switch result {
case .success(let verification):
    switch verification {
    case .verified(let transaction):
        await transaction.finish()    // comes here 
    ...
}

it is successful (I get result with verified transaction in it, my server validates the receipt).

But I can't get any transactions after it (I need it to initiate iOS 15 refund in-app flow), nothing from these works: Transaction.currentEntitlements, Transaction.latest(for: productId), Transaction.currentEntitlement(for: productId) - always nil and []. Even Transaction.updates doesn't emit anything.

The only mention I got is https://developer.apple.com/forums/thread/689480

Any ideas?

1 Answers

I ran into a similar issue with storekit2 and it looks like it’s by design, at least according to this apple response on the dev forums https://developer.apple.com/forums/thread/687199

I haven’t looked if there is a way to do this in the original store kit api.

Related