codeOffer(referenceName:)
Sets an offer code for the transaction in the testing environment.
Declaration
static func codeOffer(referenceName: String) -> Product.PurchaseOptionParameters
- referenceName:
The reference name of the offer code to apply to the transaction. You need to set up offer codes in your StoreKit configuration file.
Discussion
Use this purchase option when you test your app in Xcode using StoreKit Test and call buyProduct(identifier:options:).
Set up the offer codes to use in this call in your StoreKit configuration file. For more information, see Setting up StoreKit Testing in Xcode.
When you apply this option, the purchase transaction simulates a customer redeeming an offer code and includes the offer code you specify.