How can I test redeeming an offer code?

Asked on 2024-07-30

1 search

To test redeeming an offer code, you can use StoreKit testing in Xcode. This is the quickest way to test offers while developing your app. Here are the steps you can follow:

  1. Configure Winback Offers in Xcode:

    • Open the StoreKit configuration where you have set up your local and app purchases.
    • Find your subscription under the auto-renewable subscriptions heading.
    • Scroll down to the Winback offers section to configure the offers.
  2. Test Different Scenarios:

    • Use the customer eligibility toggle to decide if you should receive the Winback offer in your app when you churn from a subscription.
    • Change the eligibility while debugging to test different scenarios of the customer's offer eligibility.
  3. Use StoreKit Testing in Xcode:

    • Test your purchase intent, listener, and deferral logic.
    • Add the selected offer to the purchase options in Xcode 16.

For more detailed steps, you can refer to the session Implement App Store Offers (28:02).

If you need to test promotional offers, you can also use the App Store server library to create a promotional offer signature and ensure that the offer is only redeemed the number of times you specify. For more information on this, you can refer to the session Explore App Store server APIs for In-App Purchase (21:25).

Relevant Sessions

  1. Implement App Store Offers
  2. Explore App Store server APIs for In-App Purchase