Class

SKStoreProductViewController

A view controller that provides a page where the user can purchase media from the App Store.

Declaration

class SKStoreProductViewController : UIViewController

Overview

To display a store for users to purchase media from the App Store, follow these steps:

  1. Create an SKStoreProductViewController object and set its delegate.

  2. Indicate a specific product to sell by passing its iTunes item identifier to the loadProduct(withParameters:completionBlock:) method.

  3. Present the view controller modally from another view controller in your app. Your delegate dismisses the view controller when the user completes the purchase.

Present the SKStoreProductViewController object immediately when triggered by a user interaction, such as tapping a Buy button. Load the product information before presenting the view controller to ensure a seamless user experience.

This class ignores modalPresentationStyle settings, and those settings have no impact on the sheet's presentation.

Prevent Exceptions

The SKStoreProductViewController class does not support subclassing or embedding, and must be used as-is.

This class throws the following runtime exceptions:

SKUnsupportedClassException

Thrown if the app attempts to instantiate a subclass of SKStoreProductViewController.

SKUnsupportedPresentationException

Thrown if the app attempts to use an unsupported presentation mode for SKStoreProductViewController, such as embedding it as a child view controller or attempting to use it in a popover.

Topics

Setting a Delegate

var delegate: SKStoreProductViewControllerDelegate?

The store view controller’s delegate.

protocol SKStoreProductViewControllerDelegate

A protocol called when the user dismisses the store screen.

Loading a New Product Screen

Offering Media for Sale in Your App

Allow users to purchase media in the App Store from within your app.

Product Dictionary Keys

Keys for identifying products and the tokens for affiliates and campaigns.

See Also

Affiliate Recommendations

Offering Media for Sale in Your App

Allow users to purchase media in the App Store from within your app.

class SKAdNetwork

A class that validates advertiser-driven app installations.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software