Instance Method

loadProduct(withParameters:completionBlock:)

Loads a new product screen to display.

Declaration

func loadProduct(withParameters parameters: [String : Any], completionBlock block: ((Bool, Error?) -> Void)? = nil)

Parameters

parameters

A dictionary describing the content you want the view controller to display.

See Product Dictionary Keys for keys that describe the product.

See Ad Network Install Validation Keys for keys that describe an impression in an advertising campaign.

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

true if the product information was successfully loaded, otherwise false.

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.

See Also

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.