Interface with StoreKit Using the Store Manager

In Add In-App Purchase Support to the Project, you added a group of files. One of those files, StoreManager.swift, is responsible for interfacing with StoreKit.

StoreKit, or rather the StoreKit framework, is what handles all of the in-app purchases and interactions your game has with the App Store. This includes loading the product details, prompting the player for payment details, and validating receipts (something you won’t do in this book).

When working with StoreKit and in-app purchases, you’re mostly dealing with products, payments, requests, and transactions using classes like:

  • SKProduct
  • SKRequest
  • SKPayment
  • SKPaymentTransaction

These four classes (some of which you’ve already been using but ...

Get Apple Game Frameworks and Technologies now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.