SKStoreProductViewController Class Reference
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/StoreKit.framework |
| Availability | Available in iOS 6.0 and later. |
| Companion guide | |
| Declared in | SKStoreProductViewController.h |
Overview
A SKStoreProductViewController object presents a store that allows the user to purchase other media from the App Store. For example, your app might display the store to allow the user to purchase another app.
To display a store, create a new SKStoreProductViewController object and set its delegate. Then, present the view controller modally from another view controller in your app. Your delegate dismisses the view controller when the user completes the purchase.
To choose a specific product, call the loadProductWithParameters:completionBlock: method, passing the iTunes item identifier for the item you want to sell.
Properties
delegate
The store view controller’s delegate.
Discussion
Your application must set the delegate before presenting the store view controller.
Availability
- Available in iOS 6.0 and later.
Declared In
SKStoreProductViewController.hInstance Methods
loadProductWithParameters:completionBlock:
Loads a new product screen to display.
Parameters
- parameters
A dictionary describing the content you want the view controller to display. See “Product Dictionary Keys.”
- block
A block to be called when the product information has been loaded from the App Store. The completion block is called on the main thread and receives the following parameters:
- result
YESif the product information was successfully loaded, otherwiseNO.- error
If an error occurred, this object describes the error. If the product information was successfully loaded, this value is
nil.
Discussion
In most cases, you should load the product information and then present the view controller. However, if you load new product information while the view controller is presented, the contents of the view controller are replaced after the new product data is loaded.
Availability
- Available in iOS 6.0 and later.
Declared In
SKStoreProductViewController.hConstants
Product Dictionary Keys
Keys supported in the product dictionary.
NSString * const SKStoreProductParameterITunesItemIdentifier;
Constants
© 2012 Apple Inc. All Rights Reserved. (Last updated: 2012-09-19)