In-App Purchase

Offer users additional content and services through purchases made within your app.

Overview

In-App Purchase allows you to offer users the opportunity to purchase in-app content and features. Purchases can be made within your app, or directly from the App Store if you choose to promote the products there.

The StoreKit framework connects to the App Store on your app’s behalf to prompt for and securely process payments. The framework then notifies your app, which delivers the purchased products. To validate purchases, you can verify receipts on your server with the App Store or on the device. For auto-renewable subscriptions, the App Store can also notify your server of key subscription events.

A diagram of the interactions between StoreKit, your app, the App Store, and your server that occur during a transaction.

To use In-App Purchase, you must first configure the products you wish to offer users in App Store Connect. As you develop your app, you can add or remove products and refine or reconfigure your existing products.

Understand Product Types

Product types let you use In-App Purchase across a range of business models within your app by providing several different product behaviors. There are four In-App Purchase types you can offer:

  • Consumables are used once and depleted, and can be purchased multiple times.

  • Non-consumables are purchased once and do not expire.

  • Auto-renewable subscriptions to services or content are purchased once and renew automatically on a recurring basis until users decide to cancel.

  • Non-renewing subscriptions to services or content provide access over a limited duration, do not renew automatically, and can be purchased again.

Non-consumables and auto-renewable subscriptions can be synced and restored across devices using StoreKit. When a user purchases an auto-renewable or non-renewing subscription, your app is responsible for making it available across all the user's devices, and for enabling users to restore past purchases.

Topics

First Steps

class SKPaymentQueue

A queue of payment transactions to be processed by the App Store.

protocol SKPaymentTransactionObserver

A set of methods that process transactions, unlock purchased functionality, and continue promoted in-app purchases.

Retrieving Product Information

class SKProductsRequest

An object that can retrieve localized information from the App Store about a specified list of products.

class SKProduct

Information about a product you previously registered in App Store Connect.

class SKProductsResponse

An App Store response to a request for information about a list of products.

class SKProductSubscriptionPeriod

An object containing the subscription period duration information.

Requesting Payment

class SKPayment

A request to the App Store to process payment for additional functionality offered by your app.

class SKMutablePayment

A mutable request to the App Store to process payment for additional functionality offered by your app.

class SKPaymentQueue

A queue of payment transactions to be processed by the App Store.

Delivering Products

class SKDownload

Downloadable content associated with a product.

Restoring Purchased Products

class SKReceiptRefreshRequest

A request to refresh the receipt, which represents the user's transactions with your app.

class SKRequest

An abstract class that represents a request to the App Store.

class SKPaymentTransaction

An object in the payment queue.

func SKTerminateForInvalidReceipt()

Terminates an app if the license to use the app has expired.

Promoting In-App Purchases

class SKProductStorePromotionController

A product promotion controller for customizing the order and visibility of in-app purchases per device.

Testing Promoted In-App Purchases

Test your in-app purchases before making your app available in the App Store.

Offering Introductory Pricing

Offering Introductory Pricing in Your App

Offer introductory pricing to eligible users for auto-renewable subscriptions.

class SKProductDiscount

A class that contains the details of a discount for a subscription product.

Working with Subscriptions

Offering a Subscription Across Multiple Apps

Support a single auto-renewable subscription across multiple apps.