How to enable or disable StoreKit Ask to Buy in XCode
A step by step guide on enabling and disabling StoreKit Ask to Buy which is used to test pending purchases in XCode.
The guide was made using our Free iOS StoreKit 2 Open Source project which is recommended for developers or business folk wishing to learn about how In-App Purchases or Subscriptions work and the code behind them.
In order for you to be able to test pending transactions using StoreKit Ask to Buy and for it to work locally, you must have a StoreKit Configuration File setup in XCode and have StoreKit testing enabled.
To learn how to do this consult the guides below.
Step One: Select the StoreKit Configuration File
In XCode, select the StoreKit Configuration File.
Step Two: Enable or Disable Ask to Buy
In the menu bar at the top, press Editor and enable or disable ask to buy by pressing Enable Ask to Buy or Disable Ask to Buy, depending on whether ask to buy was already enabled or disabled.
Step Three: Clean & Run
To guarantee that the change in Localization takes place, clean the XCode project by pressing Command + Shift + K.
Then run the project by pressing Command + R or the play button in XCode.
Looking to learn more about developing apps with StoreKit 2?
Read our comprehensive development guide linked below to learn about all the secrets behind developing In-App Purchases and Subscriptions with StoreKit 2.