Class

SKStoreProductViewController

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

Declaration

@interface 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 loadProductWithParameters: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

delegate

The store view controller’s delegate.

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.

- loadProductWithParameters:completionBlock:

Loads a new product screen to display.

Product Dictionary Keys

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

Relationships

Inherits From

See Also

Affiliate Recommendations

Offering Media for Sale in Your App

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

SKAdNetwork

A class that validates advertiser-driven app installations.