The Lifecycle of Purchases
The lifecycle of a StoreKit purchase is:
- Obtain valid product identifiers and present a UI for the user to choose one.
- If user choose a product, you then submit that product for StoreKit for purchase.
- The purchase then moves through a few phases in the StoreKit transaction queue, which you attach code to monitor, until either a purchase is confirmed, or cancelled (or deferred).
- If a product/subscription has been purchased, then you move to verification step.
- You then load the StoreKit receipt and verify, either locally or with a server.
- Once a purchase is confirmed, you then finish the transaction (if your purchase is not consumable, in which case you make sure the application saves whatever it needs to update in relation to the transient purchase, then you complete the transaction).