Contents

askToBuyEnabled

A Boolean value that determines whether the testing environment simulates an Ask to Buy scenario.

Declaration

var askToBuyEnabled: Bool { get set }

Discussion

The default value is false. Enabling this property causes all purchases to require approval until you disable it. To approve the purchase in the testing environment, call approveAskToBuyTransaction(identifier:), and to decline it, call declineAskToBuyTransaction(identifier:).

Changing this property overrides its setting in the StoreKit configuration file for this test session. Call resetToDefaultState() to revert all settings to those in the configuration file.

See Also

Testing Ask To Buy transactions