Contents

Product.PurchaseOption

Optional settings for a product purchase that add account information, purchase details, and offers, or that specify behaviors.

Declaration

struct PurchaseOption

Mentioned in

Overview

Associate purchase options with an in-app purchase when you call the methods to initiate a purchase, such as purchase(options:) or purchase(confirmIn:options:). Use the testing-specific options with StoreKit Test or in the sandbox testing environment.

Purchase options enable you to provide additional information for the purchase, such as an app account token, promotional offer, win back offer, and quantity. You can also use purchase options to indicate how the transaction behaves if the storefront changes, and to indicate whether the transaction is eligible for an introductory offer.

Use purchase options during testing

In the sandbox testing environment, use simulatesAskToBuyInSandbox(_:) to test Ask To Buy scenarios.

In the Xcode testing environment with StoreKit Test, use the following testing-specific purchase options when you call buyProduct(identifier:options:):

Topics

Setting the purchase options

Specifying the behavior for storefront changes

Specifying eligibility for an introductory offer

Setting options for StoreKit Testing in Xcode

Setting options for sandbox testing

Setting custom purchase options

Type Methods

See Also

Purchasing a product