Alle Artikel

2. Dezember 2026

StoreKit 2 basics: products, transactions and restore purchases, 2026

How StoreKit 2 handles products, purchases, transactions and restore: what to verify, when to finish, and why you still ship a Restore Purchases button.

Concentric open rings with one acid dot on a dotted canvas
Illustration: Kallos Labs.

What StoreKit 2 in-app purchases involve

A StoreKit 2 in-app purchase has four parts: a product list, a purchase call, a stream of transactions, and a way to restore. The rule that ties them together is short. Verify every transaction, deliver what was bought, then finish the transaction.

Node map diagram with four parts: a product list, a purchase call, a stream of transactions and a way to restore
Node map: What StoreKit 2 in-app purchases involve.

This guide walks through each part in the order your app meets them. It is written for founders and product leads scoping an iOS build, and for the engineers who will write it. Everything about Apple's behavior below comes from Apple's own pages, linked where it is used. If we name an API without a source, check Apple's current documentation before you build on it.

What StoreKit 2 changes

StoreKit 2 is Apple's Swift-first purchase framework. Apple's StoreKit overview says it "uses modern Swift and SwiftUI APIs" and takes advantage of "Swift concurrency to simplify how you get product information, merchandise products in your app."

Three changes matter for scoping:

  • Signed transactions. Apple says transactions are "cryptographically signed by the App Store in JSON Web Signature format." Your app can check them on the device, so you do not need a server just to trust a purchase.
  • Same data as the server. StoreKit 2 APIs "return the same information as the App Store Server API," so the app and a backend see one picture of a transaction.
  • Automatic sync. The App Store synchronizes new transactions across all of a customer's devices, as Apple's StoreKit 2 support talk explains. The overview adds that up-to-date transactions are available "whether someone launches it for the first time or downloads it on another device."

Show products in the app

You have two routes to a store screen: build your own list, or use Apple's views. The overview names StoreView, ProductView and SubscriptionStoreView, and says they present the description, price and duration "with as little as one line of code." Localization for languages and currencies is built in.

For a small app, the views get you to a testable store fast. A custom screen makes sense when the purchase is part of your product's identity, for example a one-time upgrade that sits inside an onboarding flow. Either way, build the screen so you can preview it with sample products. Our SwiftUI previews and testing workflow covers how to do that without a device.

One scoping point: pick your product types before you design the screen. Apple's launch-time examples branch on three of them: non-consumable, non-renewable and auto-renewable. Each one needs different logic later, when you read what the customer owns.

Buy a product and verify it

A purchase call returns a result, and StoreKit wraps the transaction in a verification result. In Apple's words, VerificationResult and PurchaseResult "validate a transaction after a successful purchase or restore."

The rule for your code: grant access only for a verified transaction. If verification fails, do not deliver the content. Apple's own sample code throws a failedVerification error in that case and skips delivery.

Apple also added appAccountToken in iOS 15. It lets you tie a purchase to the account in your own app that started it, and it comes back on completed transactions. If your app has accounts, set it. It makes support and refund questions much easier to answer.

When delivery is done, call finish() on the transaction. More on that next.

Listen for Transaction.updates from launch

Not every transaction comes from your purchase button. Apple's WWDC22 session on proactive restore says to start listening for Transaction.updates at app launch, because transactions "can arrive at any time" from:

  • Family Sharing
  • Ask to Buy approvals
  • code redemptions
  • subscription auto-renewals
  • interrupted purchases
  • revocations, such as refunds or lost Family Sharing access

The pattern in Apple's sample is a long-lived task that iterates Transaction.updates. For each result it verifies the transaction, refreshes the customer's product status, and finishes the transaction. If verification fails, it delivers nothing.

Finishing isn't optional. Apple's guidance is "Always finish a transaction." The Tech Talk adds that unfinished transactions stay in the queue, which helps recover from interruptions on the device. Once you finish one, StoreKit stops returning it on every device. Deliver first, then finish.

Read Transaction.currentEntitlements before showing Buy

Transaction.currentEntitlements tells you what the customer owns right now. Apple's session says to read it early, before any Buy button is shown, so you never offer something the customer already has.

The sample works like this:

  1. Iterate Transaction.currentEntitlements.
  2. Verify each result.
  3. Branch on productType: .nonConsumable, .nonRenewable or .autoRenewable.
  4. Update your store's owned-products state.

Non-renewing subscriptions have no inherent expiration in StoreKit, so the sample computes one from the purchase date. Plan for that: your own product rules decide how long a non-renewing purchase lasts.

For auto-renewable subscriptions, Apple says to use Product.SubscriptionInfo.RenewalState and to handle the inactive states .expired, .revoked and .inBillingRetryPeriod. A subscription that is in billing retry is not the same as one that was cancelled, and your screens should say which one it is.

The Tech Talk makes the practical point: the method gives the immediate status of a customer's purchases, so you can grant products "without requiring login or a Restore Purchases step."

Restore purchases and AppStore.sync

With StoreKit 2, restore happens on its own. The WWDC22 session says proactive restore needs no customer action, and that customers do not need to sign in or tap "Restore Purchases."

You still ship the button. The same session says to keep it: it is rarely used, but it lets a customer force a restore if something went wrong or they use a different Apple ID. An Apple App Store Commerce engineer put it more firmly on the developer forums in April 2022: "Providing a Restore Purchases button is still required per guidelines. As it requires customer authentication, this also gives customers a chance to verify the Apple ID signed in, or to sign-in with one if they were not already."

The reply points to AppStore.sync() as the call behind that button. Two practical notes follow from the sources:

  • Put AppStore.sync() behind a button the customer taps, not at launch. It involves customer authentication, which is the point Apple's engineer makes.
  • After it returns, read Transaction.currentEntitlements again and update your screens from that. The entitlements read is still the source of truth for what the customer owns.

The forum reply does not give a guideline section number, so check the current App Review Guidelines before you quote one in a review note.

Test before you ship

Apple's overview says to test in Xcode and in the App Store sandbox. Test the paths that are easy to skip: a purchase that is interrupted, a restore on a second device, and a customer who is signed in with a different Apple ID than the one that bought.

Before you submit, run the build through TestFlight. Our TestFlight beta testing guide covers groups, builds and Beta App Review. If your app also collects data for ads or analytics, check whether you need the App Tracking Transparency prompt, since a purchase flow often ships in the same release.

If you are scoping an app with in-app purchases and want a second pair of eyes on the plan, our iOS development service is where to start.

Takeaways

  • Start a Transaction.updates listener at launch.
  • Verify every transaction before you deliver anything.
  • Always finish a transaction after delivery.
  • Read Transaction.currentEntitlements before you show a Buy button.
  • Keep a Restore Purchases button that calls AppStore.sync() on tap.

Frequently asked questions

Do I still need a Restore Purchases button with StoreKit 2?

Yes. An Apple App Store Commerce engineer wrote on the developer forums that the button is still required per guidelines. StoreKit 2 restores state proactively, so the button is a fallback that also lets a customer confirm or switch Apple ID.

What does Transaction.currentEntitlements return?

It returns the customer's current transactions as verification results. You verify each one and branch on productType to work out what the customer owns. Read it before showing any Buy button.

When should I call transaction.finish()?

Call it after you verify the transaction and deliver the content or update your state. Unfinished transactions stay in the queue. Once finished, StoreKit no longer returns the transaction on any device.

Why start the Transaction.updates listener at launch?

Transactions can arrive outside a direct purchase call. Apple lists Ask to Buy approvals, Family Sharing, code redemptions, renewals, interrupted purchases and revocations. A listener that runs from launch catches them.

Wer das braucht, fragt meist auch nach diesen Leistungen.

Brauchen Sie so etwas für Ihr Unternehmen?

Erzählen Sie uns, was Ihnen vorschwebt, auch wenn es noch grob ist. Innerhalb von zwei Werktagen erhalten Sie eine kostenlose Durchsicht per E-Mail.

  • Antwort innerhalb von zwei Werktagen
  • NDA auf Wunsch
  • Kostenlose Durchsicht per E-Mail
intake.form
Alle Felder erforderlich