Promo Code and Offers

I am testing my app with storekit2 and all data configured in alppstoreconnectr but i would like to know how to test on simulation and configure Promo code and OffersThanks

Answered by Amilnyleve in 892452022

I did that but Promo code and Oferrs never show as an option when testing on a device. Does it require special conditions?

Hello,

If you have already configured your IAPs and offers in App Store Connect, you can build and run your app on a physical device and test in the Sandbox environment (note that this requires logging in with a Sandbox account).

If you prefer to use the simulator instead, check out StoreKit Testing in Xcode: https://developer.apple.com/documentation/xcode/setting-up-storekit-testing-in-xcode. This allows you to setup a local test environment for testing your IAPs (including offers). You can set up a StoreKit configuration file manually, or have it sync with your App Store Connect account so you can test with the same data you have already configured.

If you have any questions regarding this setup, don't hesitate to ask.

Accepted Answer

I did that but Promo code and Oferrs never show as an option when testing on a device. Does it require special conditions?

Offer codes are redeemed via the offer code redemption sheet. You can call the respective API (here's the iOS version for example: https://developer.apple.com/documentation/storekit/appstore/presentoffercoderedeemsheet(in:)) and redeem the offer code via the UI in the sheet. In production and sandbox, this requires the customer to enter the code, while in StoreKit Testing in Xcode the sheet provides a list of codes you have already configured. Are you not seeing the configured codes in the redemption sheet after setting up the test environment? Can you please provide some more information regarding your setup?

Promo codes are not supported in StoreKit Testing in Xcode.

oh ok I have an hybrid setup now for testing. Products inApp and subscriptions defined in applestoreconnectm- would that be possible for testing special offer codes ?

Can you please tell me more about this hybrid setup? You normally can't mix environments for testing (i.e.: use both Sandbox and StoreKit Testing in Xcode at the same time), you have to choose one or the other. By default, Sandbox is used when building and running apps through Xcode during development, and StoreKit Testing in Xcode is chosen when you add your configuration file to the app run scheme settings.

Both environments support testing all In-App Purchase types (consumables, non-consumables, auto-renewable subscriptions, non-renewing subscriptions)and their respective offers: In-App Purchase offer codes, subscription promotional offers, introductory offers, offer codes, and win-back offers.

Are any of these the offer type you are looking to test?

Promo Code and Offers
 
 
Q